Está en la página 1de 45

ISAN-DSP GROUP

IMAGE REGISTRATION

ISAN-DSP GROUP

Course Syllabus
Date and Time : MW 11.00-12.00 EN 4510, LAB1 TU17-20, LAB2 TH17-20
Assessments:
Attendance & Homework
5%
Lab and Homework
35%
Midterm
30%
Final
30%
Grading:
85-100% A, 75-85% B+, 70-75% B, 65-70% C+, 60-65% C,
55-60% D+, 50-55% D, 0-50% F
References:
1. Rafael C. Gonzalez and Richard E. Woods, Digital Image Processing,
Addison Wesley, 1992.
2. Anil K. Jain, Fundamentals of Digital Image Processing,
Prentice-Hall, Inc., 1989.
3. William K. Pratt, Digital Image Processing, 2nd Edition,
Wiley & Sons, Inc., 1991.

ISAN-DSP GROUP

Course Outline
1. Introduction
2. Digital Image Fundamentals
3. Image Transforms
4. Image Enhancement
5. Image Segmentation
6. Image Compression
7. Image Morphology

ISAN-DSP GROUP

Chapter 1
Introduction to Image Processing

ISAN-DSP GROUP

What is Digital Image Processing ?


Processing of a multidimensional pictures by a digital computer

Why we need Digital Image Processing ?


1.
2.

3.
4.
5.

ISAN-DSP GROUP

Digital Image
Digital image = a multidimensional
array of numbers (such as intensity image)
or vectors (such as color image)

Each component in the image


called pixel associates with
the pixel value (a single number in
the case of intensity images or a
vector in the case of color images).

10
9

15

32

10 16 28
65 70 56 43
6 26703756
32 99
54 96 67
25 6013 902296

21 54 47 42
15 8587 853943
54 65 65 39

32 65 87

78
67

92

99

ISAN-DSP GROUP

Visual Perception: Human Eye

(Picture from Microsoft Encarta 2000)

ISAN-DSP GROUP

Chapter 2: Digital Image Fundamentals

ISAN-DSP GROUP

Visual Perception: Human Eye (cont.)


1.

The lens contains 60-70% water, 6% of fat.

2.

The iris diaphragm controls amount of light that enters the eye.

3.

Light receptors in the retina


- About 6-7 millions cones for bright light vision called photopic
- Density of cones is about 150,000 elements/mm2.
- Cones involve in color vision.
- Cones are concentrated in fovea about 1.5x1.5 mm2.
- About 75-150 millions rods for dim light vision called scotopic
- Rods are sensitive to low level of light and are not involved
color vision.

4. Blind spot is the region of emergence of the optic nerve from the eye.

ISAN-DSP GROUP

Chapter 2: Digital Image Fundamentals

ISAN-DSP GROUP

Image Formation in Human Eye

ISAN-DSP GROUP

Chapter 2: Digital Image Fundamentals

ISAN-DSP GROUP

Intensity

Brightness Adaptation of Human Eye

Position

Intensities of surrounding points effect perceived brightness at each point.


In this image, edges between bars appear brighter on the right side and darker
On the left side.

ISAN-DSP GROUP

Brightness Adaptation of Human Eye (cont.)

A
Intensity

Position
In area A, brightness perceived is darker while in area B is
brighter. This phenomenon is called Mach Band Effect.

ISAN-DSP GROUP

Brightness Adaptation of Human Eye (cont.)

Simultaneous contrast. All small squares have exactly the same intensity
but they appear progressively darker as background becomes lighter.

ISAN-DSP GROUP

Imaging Geometry: Perspective Transformation


(X,Y,Z) = world coordinate

Image plane
y,Y

x,X

(X,Y,Z)

z,Z
Lens center
(x,y)
(x,y,z) = Camera coordinate system
= focal length

x
X

Z
y
Y

Eq. 1.1

ISAN-DSP GROUP

Imaging Geometry: Perspective Transformation (cont.)


Question: How can we project the real world object at (X,Y,Z) onto
the image plane (such as photographic film)?
Answer: Relation between camera coordinate (x,y,z) and world coordinate
(X,Y,Z) are given by

x
c y

z

X
Z
Y

Z
Z
Z

Eq. 1.2

Since on the image plane z is always zero, z=0, we consider only (x,y)
while z is neglected.

ISAN-DSP GROUP

Imaging Geometry: Perspective Transformation (cont.)


Equation 1.2 is not linear because of Z in the dividers so we
introduce the homogeneous coordinate to solve this problem.

X
Cartesian w Y

coordinate
Z

kX
kY

Homogeneous w

h
coordinate
kZ

k
k = nonzero constant

To convert from the homogeneous coordinate wh to the Cartesian


coordinate w, we divide the first 3 components of wh by the fourth
component.

ISAN-DSP GROUP

Imaging Geometry: Perspective Transformation (cont.)


The perspective transformation matrix for the homogeneous coordinate:

1
0
P
0

0 0
1 0
0 1
0 1

0
0

Perspective transformation becomes:

1
0
c h Pw h
0

0
1
0
0

0
0
1
1

0
0
0

kX

kX

kY
kY

kZ
kZ
k (Z )

Eq. 1.3

ISAN-DSP GROUP

Imaging Geometry: Perspective Transformation (cont.)

From homogeneous
coordinate

ch

kX

kY

kZ
k (Z )

We get camera coordinate in the image plane:

X
kX

k
(
Z


c kY

k (Z )
Z

kZ

k
(
Z

x
y

ISAN-DSP GROUP

Imaging Geometry: Inverse Perspective Transformation

wh P 1ch where

1
0
P 1
0

0 0 0
1 0 0

0 1 0

0 1 1

Eq. 1.4

ISAN-DSP GROUP

Inverse Perspective Transformation (cont.)

For an image point (x0,y0), since on


the image plane z=0, we have

kx0
ky
ch 0
0

We get the world coordinate :

kx0
ky
wh P 1ch 0
0

or

x0
w y0 ???

0

Since the perspective transformation maps 3-D coordinates to 2-D Coordinates,


we cannot get the inverse transform unless we have additional information.

ISAN-DSP GROUP

Inverse Perspective Transformation (cont.)


To find the solution, let

We get

kx0
ky
ch 0
kz

wh P 1ch

kx0
ky0

kz
k(z )

x0
X

y 0
or w Y

Z z

Eq. 1.5

ISAN-DSP GROUP

Inverse Perspective Transformation (cont.)


From Eq. 1.5,
We get

Z
z
Z

Eq. 1.6

Substituting Eq. 1.6 into Eq.1.5, we get

x0
X ( Z )

y0
Y ( Z )

Eq. 1.7

Equations 1.7 show that inverse perspective transformation requires


information of at least one component of the world coordinate of the point.

ISAN-DSP GROUP

Inverse Perspective Transformation (cont.)


x0
y0
These equations: X ( Z ) and Y ( Z )

show that points on Line L in the world coordinate


map to a single point in the image plane.
Line L

Image plane
y,Y

x,X
(X3,Y3,Z3)

(X2,Y2,Z2)

(X1,Y1,Z1)

z,Z
Lens center
(x,y)

Points (X1,Y1,Z1) , (X2,Y2,Z2), and (X3,Y3,Z3) map to


Point (x,y) in the image plane.

ISAN-DSP GROUP

Stereo Imaging: How we get depth information from


2 eyes
Image 1
y
Image 2
y

(x1,y1)
Left lens
center

(x2,y2)

right lens
center

Optical axis

World point (X,Y,Z)

ISAN-DSP GROUP

Stereo Imaging: How we get depth information from


2 eyes (cont.)
Problem: we know camera coordinates of the object on left and
right image planes (x1,y1) and (x2,y2) and want to how far from the
camera the object is located.
Note: when y-axis is parallel to the ground, we have y1 = y2
X
Image 1
(x1,y1)
Origin of world
coordinate
Image 2
system

(x2,y2)
Plane of
constant Z

ISAN-DSP GROUP

Stereo Imaging: How we get depth information from


2 eyes (cont.)
1. From the inverse perspective transform, we compute X1 and X2:

x1
X 1 ( Z1 ) and

2. Z1 and Z2 must be equal, we get

x2
X 2 ( Z 2 )

Z1 Z 2

3. Since left and right lenses are separated by distance B, we have

X 2 X1 B
4. From 1, 2 and 3, we get

x1
X 1 ( Z ) and

Solving Z yields

x2
X 1 B ( Z )

B
x2 x1

ISAN-DSP GROUP

Stereo Imaging: How we get depth information from


2 eyes (cont.)
We can locate the object if we know positions of the object
in left and right image planes using Equation:
B
Z
x2 x1
Question: While the equation is so simple but why it is very
difficult to built an automatic stereo vision system that can
reconstruct 3-D scene from images obtained from 2 cameras?
Answers: for a computer, locating the corresponding points
on left and right images is the most difficult task.

ISAN-DSP GROUP

Imaging Geometry : Affine Transformations


1. Translation

2. Scaling

3. Rotating

ISAN-DSP GROUP

Image Geometry: Translation of Object


Displace the object by vector (X0,Y0,Z0) with respect to
its old position.
X * X X0
Y * Y Y0
Z * Z Z0

(X

,Y
,

Z)

(X+X0,Y+Y0,Z+Z0)

(X,Y,Z)

X * 1
*
Y 0
Z* 0

0
1
0
0

0
0
1
0

X0
Y0

Z0

X
Y

Z

1

ISAN-DSP GROUP

Image Geometry: Translation of Frame


Translate the origin point of the frame by (X0,Y0,Z0)
with respect to the old frame
Z
X * X X0
Z
Y * Y Y0

(X
,

Y0 ,
Z0 )

(0,0,0)

Z * Z Z0

X * 1
*
Y 0
Z* 0


1 0

0
1
0
0

0 X0
0 Y0

1 Z0

0
1

X
Y

Z

1

X
The object still stays at the same position. Only the frame is moved.

ISAN-DSP GROUP

Image Geometry: Scaling


Scale by factors Sx, Sy, Sz along X, Y, and Z axes.
X * Sx X
E

Z * Sz Z

e
f
a
A

d
g

b
B

Y * S yY

X * Sx
* 0
Y
Z* 0


1 0

0
Sy
0
0

Note: Origin point is unchanged.

0
0
Sz
0

0
0

X
Y

Z

1

ISAN-DSP GROUP

Image Geometry: Rotating an object about X-axis


Rotate an object about X-axis by x in a counterclockwise
direction.
0
0
0 X
X * 1
Z
* 0 cos sin 0 Y
x
x
Y

Z * 0 sin x cos x 0 Z



0
0
0
1
1
1

X=X
Note : In this case the object is moved. Only y and z
are changed while x stills the same.

ISAN-DSP GROUP

Image Geometry: Rotating a frame about X-axis


Rotate the frame about X-axis by x in a counterclockwise
direction.
Z

Z
Y
x

0
X * 1
*
Y 0 cos x
Z * 0 sin x


0
1 0

0
sin x
cos x
0

0
0

X=X
Note : In this case the object is not moved. The frame
is rotated instead.

X
Y

Z

1

ISAN-DSP GROUP

Image Geometry: Rotating an object about Y-axis


Rotate an object about Y-axis by y in a counterclockwise
direction.
X * cos y 0 sin y 0 X
*
Y
Z
0
1
0
0
Y



Z * sin y 0 cos y 0 Z



0
0
0
1
1
1

Y= Y
X

Note : In this case the object is moved. Only x and z


are changed while y stills the same.

ISAN-DSP GROUP

Y= Y
X

Image Geometry: Rotating a frame about Y-axis


Rotate the frame about Y-axis by y in a counterclockwise
direction.
X * cos y 0 sin y 0 X
* 0
Y
Z
1
0
0
Y

Z
Z * sin y 0 cos y 0 Z


y

0
0
0
1
1
1

X
Note : In this case the object is not moved. The frame
is rotated instead.

ISAN-DSP GROUP

Image Geometry: Rotating an object about Z-axis


Rotate an object about Z-axis by z in a counterclockwise
direction.
X * cos z sin z 0 0 X
* sin
Y
cos

0
0
Y
z
z

Z
Z* 0
0
1 0 Z



0
0
0
1
1
1

Y
X
Note : In this case the object is moved. Only x and y
are changed while z stills the same.

ISAN-DSP GROUP

Image Geometry: Rotating a frame about Z-axis


Rotate the frame about Z-axis by z in a counterclockwise
direction.
X * cos z sin z 0 0 X
* sin cos 0 0 Y
Y
z
z


Z= Z

Z*
0
0
1 0 Z



0
0
0
1
1
1

Y
z

X
Note : In this case the object is not moved. The frame
is rotated instead.

ISAN-DSP GROUP

Image Geometry: How to compute a point on an image


plane from the world coordinate
z
Z

Problem: we know the location of the object


and want to know where it will be projected
on the film (image plane).

Ca
me
ra
C
Answer:
S y o o rd
st e
m inate 1. Transform the world coordinate to
the camera coordinate
2. Perform the perspective transformation

x
y
Y

World Coordinate System

ISAN-DSP GROUP

Image Geometry: How to compute a point on the image


plane from the world coordinate (cont.)
Before using the perspective transformation,
the world axes X-Y-Z must coincide with the camera
axes x-y-z, (we need some transformations).
Y
y

Image plane (z=0)


x

(x,y)

Lens center

(X,Y,Z)

(x,y,z) = Camera coordinate, (X,Y,Z) = World coordinate

ISAN-DSP GROUP

Image Geometry: Compute the camera coordinate from


the world coordinate
z
Steps from Gonzalezs book
3
Ca
me
ra
Co
S y o rd
ste
m inate

Z
x
w0 1

1. Translate* by w0
2. Pan the camera*
(rotate about Z-axis)

2
y

Gimbal center

3. Tilt the camera*


(rotate about X-axis)
4. Translate* by z = r
5. Compute the
perspective Tr.

World Coordinate System

Note : *perform on the frame

ISAN-DSP GROUP

Image Geometry: Compute the camera coordinate from


the world coordinate (cont.)
Formula from Gonzalezs book
Camera coordinate ch P C R G wh
World coordinate
Perspective tr.
Translate to the
image plane
Center by z = r

Rotate by
Pan ( z)
and Tilt ( x)

Translate to the
gimbal center w0

ISAN-DSP GROUP

Image Geometry: Compute the camera coordinate from


the world coordinate (cont.)
z
3
Ca
General case
m
er a
Co
S y o rd
ste
m inate

x
w1 1

World Coordinate System

2. Pan the camera*

3. Tilt the camera*


y

1. Translate* by w1

Gimbal center

4. Twist the camera*


(rotate about Y-axis)
5. Compute the
perspective Tr.

Note : *perform on the frame

ISAN-DSP GROUP

Image Geometry: Compute the camera coordinate from


the world coordinate (cont.)
General case
Camera coordinate

ch P R T wh
World coordinate

Perspective tr.
Rotate by
Pan ( z),
Tilt ( x),
Twist ( y)

Translate to
the image
plane center w1

También podría gustarte