1 / 41

ELE 488 Fall 2006 Image Processing and Transmission (10-12-06)

10/12/06. ELE 488 Fall 2006 Image Processing and Transmission (10-12-06). Re-sampling and Re-sizing 1D  2D, sinc interpolation nearest neighbor, bilinear, bicubic, . . . Geometric Transformation translation rotation scaling Affine.

idalee
Télécharger la présentation

ELE 488 Fall 2006 Image Processing and Transmission (10-12-06)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 10/12/06 ELE 488 Fall 2006Image Processing and Transmission (10-12-06) • Re-sampling and Re-sizing • 1D  2D, sinc interpolation • nearest neighbor, bilinear, bicubic, . . . • Geometric Transformation • translation • rotation • scaling • Affine

  2. Lower sampling rate Aliasing? Integer Subsampling by M (=2)

  3. Gaussian Blur (.5,1) followed by subsampling by 2 ,4 subsampling by 2 subsampling by 4

  4. 1 D – Decreasing Sampling Rate by M

  5. 1 D – Increasing Sampling Rate by L Use LPF (stopband edge ωc = π/M) to remove “image”.

  6. 2D Sampling – Spectrum of Sampled Signal Aliasing

  7. Resizing from M x N down to I x J y x M x N grid I x J grid Image value at red pixels known. To determine value at green pixels. (Interpolation)

  8. 2-D Interpolation Problem Image value at red pixels known To determine value at green pixels  Interpolation In Theory – sinc interpolation at new grid points, NOT practical Approximate reconstruction with reduced computation

  9. Nearest Neighbor Interpolation (mc,nc): closest red pixel to (x,y), to be interpolated Simple, Fast, but… Note: indexing from 0

  10. Bilinear Interpolation Use 4 nearest neighbors of (i,j) to interpolate the image value at (x,y)

  11. Bilinear Interpolation: final equations More computation than nearest neighbor Better accuracy Still fast More complex interpolations

  12. Resizing from I x J up to M x N M x N grid I x J grid

  13. 2-D Interpolation Problem Given image value at green pixels, to determine image value at red pixels. Same 2-D interpolation problem. Use same interpolation methods: sinc, nearest neighbor, bilinear, . . .

  14. Example nearest neighbor bilinear

  15. Second interpolation original First interpolation Reduced Complexity Interpolation only an Approximation If possible, always interpolate directly from the original image.

  16. From a Hotel Window

  17. Lense Distortion

  18. Geometric Distortion

  19. Images related by a geometric transformation

  20. Registration by manual scaling and translation

  21. Photos: P. Ramadge Spatially warp one image so that it best matches the other image. What is the correct warp?

  22. Photos: Ingrid Daubechies, Mosaic: R. Radke –5/01 What is the correct warp?

  23. Registration Using Affine Transformation translation, rotation, scaling, shearing

  24. Registration Using Projective Transformation Add: tilting

  25. Geometric Image Transformations Scale Rotation Projective Polynomial Shear Affine 2D image  2D image

  26. Interpolation • From red pixels to green pixels • Have discussed: • Sinc interpolation • Nearest Neighbor • Bilinear

  27. y’ y x’ x Geometric Mapping • Two cartesian coordinate systems: (x,y) and (x’,y’) • Forward Mapping (x’,y’) = h(x,y) • Map locations on input image plane to output image plane • Reverse or Inverse Mapping (x,y) = h-1(x’,y’) • Map locations on the output image plane back onto the input image plane

  28. y’ y x’ x Translation (Rigid Body Transformations) Translate image by Translation changes the origin of the Cartesian coordinate system, not the appearance of the image. Translation preserves length & angle..

  29. (x’, y’) (x, y) Rotation (Rigid Body Transformations) Rotate image counterclockwise by y’ x’ Transformation preserves length & angle.

  30. y n (0,0) (m,n) m x Coordinate System on the Input Image w = (x, y)Tcoordinates of pixel at (m,n) (x,y) ↔ (m,n) wt: x-y coordinates of pixel (0,0) Inverting this expression coordinates in the sample grid for the given w and wt Not necessarily integers Index from 0!

  31. y’ n’ (0,0) (m’,n’) m’ x’ Coordinate System on the Output Image w’ = (x’, y’)Tcoordinates of pixel at (m’,n’) w’t: x’-y’ coordinates of pixel (0,0) Inverting this expression Index from 0! Given w’ and wt’, this is the (non integer) coordinates in the sample grid

  32. Inverse Mapping of the Pixel Values y’ y x’ x w (m’,n’) Start from the grid coordinates of each pixel in the output image, find the cartesian coordinates w’, map these back onto input image cartesian coordinates w, then find the noninteger grid coordinates of this point on the input image. (Not necessarily integers need to interpolate)

  33. Final Step: Interpolation Use NN, bilinear or … interpolation to estimate the value of the input image at the indicated point. This is the value at the (m’,n’) pixel in the output image.

  34. Special Case: Affine Transformation Linear transformation and translation: h(w) = Hw + z = w’ Hence: translation of origin of the x-y coordinate system from the (0,0) pixel in units of pixels. translation of the origin of the x’-y’ coordinate system from the (0,0) pixel in units of pixels. translation introduced by h in units of pixels.

  35. Affine Transformation Note: By measuring all translations in units of pixels, Δ no longer appears explicitly in the equation.

  36. (m,n) (m’,n’) Example: Rotation about the image center y’ ? y x’ x

  37. Rotation example continued Rotation is an affine transformation with no translation term. For rotation about the image center: and:

  38. Scaling Uniform scaling: (preserve angle and shape) Differential scaling: Scaling is an affine transformation.

  39. Example of 3rd Order Polynomial Warping clear; clf P=[0 1; -1 0]; Pinv=[0 -1; 1 0]; I=im2double(imread('apple.jpg')); [M,N,P]=size(I); D=2/M; L=100; wt=D*[-(N+1)/2 (M+1)/2]'; wpt=D*[-(L+1) (L+1)]'; Mp=2*L+1;Np=2*L+1; a=[0 0.5 0 0.3]; b=[0 0 0.5 0.3]; for i=1:1:Mp for j=1:1:Np wp=D*P*[i-1 j-1]' + wpt; w(1)=a(1)+a(2)*wp(1)+a(3)*wp(2)+a(4)*wp(1)^3; w(2)=b(1)+b(2)*wp(1)+b(3)*wp(2)+b(4)*wp(2)^3; kh=Pinv*(w'-wt)/D + [1 1]'; [m n]=round(kh); % nearest neighbor interp. if (m>=1)&(m<=M)&(n>=1)&(n<=N) oJ(i,j,:)=I(m,n,:); else oJ(i,j,:)=[0.25 0.25 0.25]; end end end figure(2); imshow(oJ); Title(‘Transformed Image’)

  40. Example of Polynomial Spatial Warping Images: Pratt, Digital Image Processing, 2nd Ed.

  41. Δ – a scaling factor In general (not necessarily affine), • where • Δ disappears from the expression at the expense of selecting a • different warping function. • For affine h, Δdoes not play a role. • For nonlinear h it is a convenient scaling factor – selecting an • appropriate value for Δ can simplify the selection of h.

More Related