0% found this document useful (0 votes)
21 views57 pages

Lecture 5

Spm

Uploaded by

Rin Nohara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views57 pages

Lecture 5

Spm

Uploaded by

Rin Nohara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

Image Translation

Maps the position of each pixel (x,y) of an input image


to a new location (x’,y’) in the output image by
displacing it through a user specified translation (Tx,
Ty).
The Translation operator performs a transformation of
the form
Image Scaling
Image Scaling
This can be used to shrink or zoom the size of an
image.
Image reduction, commonly known as subsampling, is
performed by replacement ( of a group of pixel values
by one arbitrarily chosen pixel value from within this
group) or by interpolating between pixel values in a
local neighborhoods.
Image zooming is achieved by pixel replication or by
interpolation.
Image Scaling
• if scaling factor > 1 --- expansion of length
(Magnification)
• if scaling factor < 1 --- compression of length (Reduction)
• if scaling factor = 1 --- size doesn’t change

• If we assign same scaling value then ????


• If we assign different scaling value then ????
Image Zooming

(a) (b)
Zooming
(a) Replication of a single pixel vale
(b) Interpolation – considering neighboring values
Image Scaling
Scale matrices are
diagonal matrices
Image Rotation
An image can be rotated by a user specified angle  about a
specified point.
+ve values -> clockwise rotation
-ve -> opposite
Rotation about the origin can be given as

x2= x1* cos () - y1 * sin()


y2 = x1* sin() + y1 * cos ()

x2 cos () - sin() x1


=
y2 sin() cos () y1
ɸ is the original angular position from the horizontal & ɵ is
the rotation angle
• Then the transformation (around origin) for a point
(x,y)through an angle ɵ
2D Rotation around arbitrary point
Image Rotation
Bi-linear Interpolation.
A a 1-a
B
b
P
1-b
C D

F(P) = a*b * F(D) + (1-a)* b*F(C) +


a*(1-a)* F(B) + (1-a)*(1-b)*F(A)
Image Rotation
Algorithm

REPEAT
1. Transform (x1,y1) to (x2,y2) using the rotation
transformation.
2. Obtain a grey-level value for (x2,y2) using Bi-linear
Interpolation.
3. Assign grey-level value of (x2,y2) to (x1,y1)
UNTIL All pixels are processed
(Note : (x1,y1) is in the output (corrected) image and (x2,y2) is in
the input (distorted) image)
Rotational matrices are
orthogonal
But wise versa ???
Image Reflection
Reflection produces a mirror image like image about an
axis of reflection.
Reflection about x-axis
x2= x1
y2= -y1
Reflection about an axis oriented in any arbitrary direction
, and passing through (x0,y0).
x2 = x1 + 2 *  * (-sin ())
y2 = y1 + 2 *  * (cos ())
Where  = (x1-x2) * sin () – (y1-y0) * cos ().
Shearing
`
X-direction shear
Shearing
`
Y-direction shear
Shearing
Exercise:
Express shearing operations in matrix form.
If x-direction shearing is followed by a y-direction shearing
What is the combined (composite) transformation matrix?
• The most important applications of geometric
transformation is image registration
• It will align images taken in different modalities
• Useful in
– Medicine
– Entertainment
Basic Transformations.
• Translation.
• P’ = T +P
• Scale
• P’ = S. P
• Rotation
• P’ = R. P

We would like all transformations to be multiplications so we can


concatenate them

• For that we must express points in homogenous coordinates.


Multiple transformations
• The advantage of representing transformations in matrix
form is that a sequence of transformations can be
represented as a single composite transformation matrix
by multiplying the corresponding transformation
matrices.

• Eg: P’= A * P and P’’= B * P’ Then P’’= (B*A) * P


(B*A) is the composite transformation
Rotate around origin vs center
Homogeneous
Coordinates
Make many transformation easier
Translation in homogeneous
coordinates
X’ = x + t X’ = T*x
Concatenation
• We perform 2 translations on the same point:
Concatenation
Concatenation
Properties of translations.
Scaling
Concatenation of scales.
Transformation products, may not be commutative. The matrix
product M2 · M1 is not equal to M1 · M2, in general.
Reflection About the Line y = 0 (the x axis)
Reflection About the Line x = 0 (the y axis)
Reflection Relative to the Coordinate Origin
Non Commutative Composition

• Use matrix multiplication,


• P’ = T*(S*P) = TSP
Cont...

You might also like