Docsity

Transform an Image - Lecture Slides | CS 335, Study notes of Computer Science

Partial preview of the text

Download Transform an Image - Lecture Slides | CS 335 and more Study notes Computer Science in PDF only on Docsity!

  • CS

Y x origin f(x,y)

Y x origin f(x,y) (-y value)

 From Cartesian space to Image Space  find (x_min, xmax)  find (y_min, ymax)  new size dimensions  w = x_max – x_min  h = y_max – y_min  create newImage size (w, h)  Translate transformed points, such that:  T * (x,y) = (u,v)  newImage( u + x_min, v + y_min) = I(x,y)

Y x origin New Image Dimensions

 Forward Mapping  Inverse Mapping  Sampling

 Draw backs  Source pixels do not map directly to a single pixel in the destination space  Possibility for “holes” in the destination image  We can map the other direction

black (0,0) (0,N) (0,M) (M,N) (^1 ) (^3 ) Reverse Mapping 1 2 3 4 [x,y,s] T = A

  • [u,v,1] T

How do we sample the source to determine the intensity for the destination?

How do we sample the source to determine the intensity for the destination?

Option 1 : Pick the pixel nearest to our center. Source 2 x 2 pixels Small change results in big difference

Source 2 x 2 pixels What if we assign an intensity to each vertex and then average? 1 2 3 4 1 2 3 4 Pick the intensity which the vertex lies. New Sample =

Bi-Cubic Bi-linear Interpolation Nearest Neighbor

f x y f x y f x y f x y f x y  

f ( 0 , 0 ) f ( 0 , 1 ) f ( 1 , 0 ) f ( 1 , 1 )  xy