290 likes | 765 Views
Digital Image Processing Lecture 9: Rotation, Scaling, Shear, Affine Transformation. Courtesy. Gonzalez and Woods. Transformation. Transformations: Move and rotate objects, scaling, stretching Euclidean Transformations
E N D
Digital Image ProcessingLecture 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 = 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() Sin (ᶲ + ) = sin ᶲcos + cosᶲsin Sin (ᶲ- ) = sin ᶲcos -cos sinᶲ cos(ᶲ+ ) = cosᶲcos - sin sinᶲ cos(ᶲ- ) = cosᶲcos +sin sinᶲ (x’, y’) (x, y) r y’ = r sin (ᶲ + ) r y = r sin (ᶲ) ᶲ x’ = r cos (ᶲ + ) x = r cos (ᶲ) University Of Malakand | Department of Computer Science | UoMIPS| Dr. Engr. Sami ur Rahman | 7
Rotation University Of Malakand | Department of Computer Science | UoMIPS| Dr. Engr. Sami ur Rahman | 8
Scaling Scaling: Resizing an image University Of Malakand | Department of Computer Science | UoMIPS| Dr. Engr. Sami ur Rahman | 9
Scaling University Of Malakand | Department of Computer Science | UoMIPS| Dr. Engr. Sami ur Rahman | 10
Scaling Rescaling and interpolation University Of Malakand | Department of Computer Science | UoMIPS| Dr. Engr. Sami ur Rahman | 11
Interpolation • 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 University Of Malakand | Department of Computer Science | UoMIPS| Dr. Engr. Sami ur Rahman | 12
Shear Shear: the deformation of a material substance in which parallel internal surfaces slide past one another No shear Horizontal shear Vertical shear University Of Malakand | Department of Computer Science | UoMIPS| Dr. Engr. Sami ur Rahman | 13
Shear Horizontal shear Vertical shear University Of Malakand | Department of Computer Science | UoMIPS| Dr. Engr. Sami ur Rahman | 14
Affine Transformation • 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). • Does not necessarily preserve angles or lengths. University Of Malakand | Department of Computer Science | UoMIPS| Dr. Engr. Sami ur Rahman | 15