0% found this document useful (0 votes)
15 views

Lec4 Imaging Geometry

The document discusses various imaging geometry transformations including translation, scaling, and rotation. Translation moves an object by adding displacements to the x, y, and z coordinates. Scaling resizes an object by multiplying the coordinates by scaling factors. Rotation rotates an object around the x, y, or z axes by applying rotation matrices. Inverse transformations can recover the original coordinates before a transformation.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Lec4 Imaging Geometry

The document discusses various imaging geometry transformations including translation, scaling, and rotation. Translation moves an object by adding displacements to the x, y, and z coordinates. Scaling resizes an object by multiplying the coordinates by scaling factors. Rotation rotates an object around the x, y, or z axes by applying rotation matrices. Inverse transformations can recover the original coordinates before a transformation.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 35

Lecture # 04:

Imaging Geometry:
Imaging Geometry:

 Imaging Geometry plays a very important part in Image


processing, as it deals with the techniques and transformation
for mapping Real world objects and their characteristics on
Image plane.

 Any point in 3D co ordinate system is represented by BLOCK


letters, termed as World Coordinate system.
 W(X,Y,Z)

 Any point in 2D co ordinate system / Image plane is


represented by small letters, termed as Camera coordinate
system.
 f (x, y)
Translation:
Y
P2(X2,Y2,Z2)

(dx,dy,dz)

P1(X1,Y1,Z1)

Z
Translation:

 Suppose that the task is to translate a point P1, with


coordinate values (x1 , y1 , z1 ) to new location P2,by Using
displacement ( dx , dy , dz).

 The translation is easily accomplished by using the equation:

X2 = X1 + dx ===>(i)
Y2 = Y1 + dy ===>(ii)
Z2 = Z1 + dz ===>(iii)
Translation:

 Where (X2, Y2, Z2) are new points and can be represented in
Matrix form, as:

 X2 1 0 0 dx x1
y2 0 1 0 dy y1
z2 0 0 1 dz z1

V* = T V
where, V* is the new point,
T is the translation matrix,
and V is the original point.
Translation:
 Here, the product of Matrices T & V seems Invalid,
As Columns of T = Rows of V

 So we can generalize this transformation by inserting a DUMMY


row in all three matrices.
V* = T V
X2 100 dx x1
y2 010 dy y1
z2 00 1 dz z1
1 00 0 1 1

1 0 0 dx
0 1 0 dy
T = 0 0 1 dz Translation Matrix
0 0 0 1
Inverse Translation:

 The Initial Point P1 can be traced back by applying the Inverse


Translation, that is:

V = T-1
V* X1 1 0 0 -dx x2
y1 0 1 0 -dy y2
z1 0 0 1 -dz z2
1 000 1 1

1 0 0 -dx
T-1 = 0 1 0 -dy Inverse Translation
0 0 1 -dz Matrix
0 0 0 1

T . T-1 = I
Translation:
Original Image Translated Image
Translation:
Translated Image Translated Image

This property is used in adjusting the Objects on Monitor screen.


Scaling:

 The scale operator performs a geometric transformation which


can be used to shrink or zoom the size of an image.

 The shrink or Zoom, depends upon the vales of scaling factor.

 For values between 0 &1, the resultant Image is shrinked.

 For values greater than 1, the resultant Image is expanded by


that factor.
Scaling:
 The Scaling is easily accomplished by using the equations:

X2 = X1 * sx ===>(i)
Y2 = Y1 * sy ===>(ii)
Z2 = Z1 * sz ===>(iii)

 Where (X2, Y2, Z2) are new points and expressed in Matrix form as:

X2 sx 0 0 0 X1
V* = T
Y2 = 0 sy 0 0 Y1
V
Z2 0 0 sz 0 Z1
1 0 0 0 1 1

Where T represents the Scaling Matrix.


Scaling:
Original Image Scaled Image at 0.5*0.5
Scaling:
 The Initial Scale can be traced back by applying the Inverse
Scaling, that is:

V = T-1
V* X1 1/Sx 0 0 0 x2
y1 0 1/Sy 0 0 y2
z1 0 0 1/Sz 0
z2 1 0 0 0 1
1
1/Sx 0 0 0
0 1/Sy 0 0 Inverse Translation
T-1
0 0 1/Sz 0 Matrix
0 0 0 1

T . T-1 = I
Rotation :
 The transformation used for 3-D rotation is inherently more
complex than the Transformations discussed so far.

 The simplest from of these transformations is for Rotation of a


point about the coordinate axes.

 To rotate a point about another arbitrary Point in space, we


require three transformation:

 The first translate the arbitrary point to the Origin,


 The second performs the rotation, and
 The third translates the point back to its Original position.
Rotation :

 Rotation of a point about the Z coordinate axis by an angle  is


achieved by using the transformation.

 The rotation angle  is measured clockwise when looking at the


region from a Point on the +Z axis. This transformation affects
only the values of X and Y coordinates.

 The rotation operator performs a geometric transform which


maps the position ( x1, y1 ) of a picture element in an input
image onto a position ( x2, y2 ) in an output image by rotating
it through a user-specified angle ө about an origin (0,0).
Rotation along Z-axis:
Y
P2(X2,Y2,Z2)
R is length of vector.
P1(X1,Y1,Z1)
φ is initial angle with X
axis.
R
Y2

Y1
R
θ
φ
0 X2 X

X1

Z
Rotation along Z-axis:
 Assume that the Vector (R) is making an angle of φ with X
axis.

 So initially, the components can be achieved as:


 X1=R cos φ
 Y1=R sin φ
 Z1=Z1

 If we rotate the vector R by θ around Z-axis in Counter


clock wise Direction, then now point formed will be given
by:

 X2=R cos (φ+θ)


 Y2=R sin (φ+θ )
 Z2=Z1 (Un changed axis)
Rotation along Z-axis:
 By expanding the terms of Sin and Cosine, we get:

X2 = R cosθ cosφ - R sinφ sinθ


Y2 = R sinθ cosφ + R sinφ cosθ
Z2= Z1

 But, we have assumed initially that:


R cosφ=x1 ===>(a)
R sinφ=y1 ===>(b)

 So our new point (x2,Y2,z2) becomes:

X2 = X1 cosθ - Y1 sinθ
Y2 = X1 sinθ + Y1 cosθ
z2= z1
Rotation along Z-axis:
 For matrix representation, these equations can be interpreted
as:

X2 = X1 cosθ - Y1 sinθ + 0
Y2 = X1 sinθ + Y1 cosθ + 0
z2 = 0 + 0 + z1

 In form of matrices, the rotation operation can be given as:

x2 cosθ -sinθ 0 x1
y2 sinθ cosθ 0 y1
z2 0 0 1 z1

V* = RθZ V
Inverse Rotation along Z-axis:

In form of matrices, the Inverse rotation operation can be


given as:

V = (RθZ)-1 V*
x1 cosθ sinθ 0 x2
y1 -sinθ cosθ 0 y2
z1 0 0 1 z2

(RθZ)-1 represents the Inverse Rotation Matrix.

(RθZ). (RθZ)-1 = I
Rotation along Y-Axis:
 Assume that the Vector (R) is making an angle of φ with Z-axis.

 So initially, the components can be achieved as:

 X1=R sin φ
 Y1=Y1
 Z1=R cos φ

 If we rotate the vector R by β around Y-axis in Counter clock


wise Direction, then now point formed will be given by:

 X2=R sin (φ+ β)


 Y2= Y1 (Un changed axis)
 Z2=R cos (φ+ β )
Rotation along Y-Axis:
 By expanding the terms of Sin and Cosine, we get:

X2 = R sinφ cos β + R cosφ sin β


Y2= Y1
Z2 = R cosφ cos β - R sinφ sin β

 But, we have assumed initially that:

R cosφ=x1 ===>(a)
R sinφ=z1 ===>(b)

 So our new point (x2,Y2,z2) becomes:

X2 = X1 cosβ + Z1 sinβ
Y2 = Y1
z2 = Z1 cosβ - X1 sinβ
Rotation along Y-Axis:
 For matrix representation, these equations can be interpreted
as:

X2 = X1 cosβ + 0 + Z1 sinβ
Y2 = 0 + Y1 + 0
z2 = -X1 sinβ + 0 + Z1 cosβ

 In form of matrices, the rotation operation can be given as:

x2 cosβ 0 +sinβ x1
=
y2 0 1 0 y1
z2 -sinβ 0 cosβ z1

V* = R β
Y
V
Inverse Rotation along Y-axis:

In form of matrices, the Inverse rotation operation can be


given as:
V = (R β Y)-1 V*

x1 cosβ 0 -sinβ x2
y1 0 1 0 y2
z1 sinβ 0 cosβ z2

(R β Y)-1 represents the Inverse Rotation Matrix.

(R β Y).(R β Y)-1 = I
Rotation along X-Axis:
 Assume that the Vector (R) is making an angle of φ with Y-axis.

 So initially, the components can be achieved as:

 X1=X1
 Y1=R cosφ
 Z1=R sinφ

 If we rotate the vector R by α around X-axis in Counter clock


wise Direction, then now point formed will be given by:

 X2=X1 (Un changed axis)


 Y2=R cos (φ+α )
 Z2=R sin (φ+α )
Rotation along X-Axis:
 By expanding the terms of Sin and Cosine, we get:

X2= X1
Y2 = R cosφ cos α - R sinφ sinα
Z2 = R sinφ cos α + R cosφ sin α

 But, we have assumed initially that:


R cosφ=y1 ===>(a)
R sinφ=z1 ===>(b)

 So our new point (x2,Y2,z2) becomes:

X2 = X1
Y2 = Y1 cos α - Z1 sinα
z2 = Z1 cos α + Y1 sin α
Rotation along X-Axis:
 For matrix representation, these equations can be interpreted
as:

X2 = X1 + 0 + 0
Y2 = 0 + Y1 cos α - Z1 sin α
Z2 = 0 + Y1 sin α + Z1 cos α

 In form of matrices, the rotation operation can be given as:

x2 1 0 0 x1
=
y2 0 cos α -sin α y1
z2 0 sin α cos α z1

V* = R α
X
V
Inverse Rotation along Y-axis:

In form of matrices, the Inverse rotation operation can be


given as:
V = (R α )
X -1
V*

x1 1 0 0 x2
y1 0 cosα sinα y2
z1 0 -sinα cosα z2

(R α )
X -1
represents the Inverse Rotation Matrix.

(R α
X
). (R α )
X -1
= I
Inverse Rotation:
The Inverse rotation of an angle, say (θo), around an axis is,
equivalent to the rotation by (–θo) around same axis.

For example, Inverse Rotation of θ around Z axis is equivalent to


the rotation of –θ around Z axis.

[RθZ]-1 = [R-θZ]
Cosθ sinθ 0 Cosθ sinθ 0
-sinθ cosθ 0 = -sinθ cosθ 0
0 0 1 0 0 1

Remember that Rotation Matrices are Ortho normal!


T 1 i  j
Ri  R j  
0 otherwise
Rotation:

Original Image
Rotation:

Rotated @ 180o Rotated @ 270o


Affine Transformation:

 The general affine transformation is commonly


written in homogeneous coordinates as shown
below:
Affine Transformation:
 Translation:
 By defining only the B matrix, this
transformation can carry out pure Translation:
Affine Transformation:
 Rotation:
 Pure Rotation uses the A matrix and is defined
as (for positive angles being clockwise
rotations):
Affine Transformation:
 Scaling
 Similarly, pure Scaling is:

You might also like