{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

EECE253_08_FrequencyFiltering

EECE253_08_FrequencyFiltering - EECE\CS 253 Image...

This preview shows pages 1–8. Sign up to view the full content.

EECE\CS 253 Image Processing Richard Alan Peters II Department of Electrical Engineering and Computer Science Fall Semester 2007 Lecture Notes Lecture Notes: Frequency Filtering This work is licensed under the Creative Commons Attribution-Noncommercial 2.5 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
December 6, 2011 2 December 6, 2011 2 1999-2007 by Richard Alan Peters II Convolution Property of the Fourier Transform . } { Moreover, . } { Then, ). , ( and ) , ( Transforms Fourier have ) , ( and ) , ( functions Let G F g f G F g f v u G v u F c r g c r f = = F F The Fourier Transform of a  convolution equals the product of the  Fourier Transforms.  Similarly, the  Fourier Transform of a convolution is  the product of the Fourier Transforms The Fourier Transform of a  convolution equals the product of the  Fourier Transforms.  Similarly, the  Fourier Transform of a convolution is  the product of the Fourier Transforms * = convolution · = multiplication
December 6, 2011 3 December 6, 2011 3 1999-2007 by Richard Alan Peters II Convolution via Fourier Transform Image & Mask Transforms Pixel-wise Product Inverse Transform

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
December 6, 2011 4 December 6, 2011 4 1999-2007 by Richard Alan Peters II 1. Read the image from a file into a variable, say I . 2. Read in or create the convolution mask, h . 3. Compute the sum of the mask: s = sum(sum(h)); 4. If s == 0, set s = 1; 5. Create: H = zeros(size(I)) ; 6. Copy h into the middle of H . 7. Shift H into position: H = ifftshift(H); 8. Take the 2D FT of I and H : FI=fft2(I); FH=fft2(H); 9. Pointwise multiply the FTs: FJ=FI.*FH; 10. Compute the inverse FT: J = real(ifft2(FJ)); 11. Normalize the result: J = J/s; How to Convolve via FT in Matlab For color images you may need to  do each step for each band  separately. For color images you may need to  do each step for each band  separately. The mask is usually 1-band The mask is usually 1-band
December 6, 2011 5 December 6, 2011 5 1999-2007 by Richard Alan Peters II Coordinate Origin of the FFT Center = (floor( R /2)+1, floor( C /2)+1) Center = (floor( R /2)+1, floor( C /2)+1) Even Even Odd Odd Image Origin Weight Matrix Origin Image Origin Weight Matrix Origin After FFT shift After IFFT shift After FFT shift After IFFT shift

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
December 6, 2011 6 December 6, 2011 6 1999-2007 by Richard Alan Peters II 5 6 4 8 9 7 2 3 1 1 2 3 4 5 6 7 8 9 Matlab’s fftshift and ifftshift J = fftshift(I): I ( 1 , 1 ) J ( R /2 + 1 , C /2 + 1 ) I = ifftshift(J): J ( R /2 + 1 , C /2 + 1 ) I ( 1 , 1 ) where x = floor(x) = the largest integer smaller than x . 1 2 3 4 5 6 7 8 9 5 6 4 8 9 7 2 3 1
December 6, 2011 7 December 6, 2011 7 1999-2007 by Richard Alan Peters II Blurring: Averaging / Lowpass Filtering Blurring results from: Pixel averaging in the spatial domain: Each pixel in the output is a weighted average of its neighbors.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}