Dr. Engr. Sami ur Rahman Digital Image Processing Lecture 9: Rotation, Scaling, Shear, Affine Transformation
University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 2 Courtesy Gonzalez and Woods
Transformation Transformations: Move and rotate objects, scaling, stretching Euclidean Transformations The Euclidean transformations are the most commonly used transformations. An Euclidean transformation is either a translation, a rotation, or a reflection. The angles and lengths remain constant. University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 3
Translation University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 4
Translation University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 5
Translation University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 6
Rotation (x, y) (x’, y’) x = r cos () y = r sin () x’ = r cos ( + ) y’ = r sin ( + ) Trig Identity… x’ = r cos() cos( ) – r sin() sin( ) y’ = r cos() sin( ) + r sin() cos( ) Substitute… x’ = x cos( ) - y sin( ) y’ = x sin( ) + y cos( ) r x = r cos () y = r sin () x’ = r cos ( + ) y’ = r sin ( + ) r University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 7 Sin ( + ) = sin cos + cos sin Sin ( - ) = sin cos - cos sin cos ( + ) = cos cos - sin sin cos ( - ) = cos cos +sin sin
Rotation University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 8
Scaling University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 9 Scaling: Resizing an image
Scaling University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 10
Scaling University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | Rescaling and interpolation
Interpolation University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 12 Interpolation: Constructing new data points from existing data points Types of interpolation Nearest neighbor interpolation Linear interpolation Bilinear interpolation Polynomial interpolation Piecewise constant interpolation Spline interpolation
Shear University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 13 Shear: the deformation of a material substance in which parallel internal surfaces slide past one another Horizontal shearVertical shearNo shear
Shear University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 14 Horizontal shear Vertical shear
Affine Transformation University Of Malakand | Department of Computer Science | UoMIPS | Dr. Engr. Sami ur Rahman | 15 Affine transformation or affine map or an affinity: A transformation which preserves straight lines (i.e., all points lying on a line initially still lie on a line after transformation) Preserves ratios of distances between points lying on a straight line (e.g., the midpoint of a line segment remains the midpoint after transformation).midpoint Does not necessarily preserve angles or lengths.
Thanks for your attention