This preview shows pages 1–7. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 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 AttributionNoncommercial 2.5 License. To view a copy of this license, visit http://creativecommons.org/licenses/bync/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA. 27 April 2008 2 27 April 2008 2 19992007 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 27 April 2008 3 27 April 2008 3 19992007 by Richard Alan Peters II Convolution via Fourier Transform Image & Mask Transforms Pixelwise Product Inverse Transform 27 April 2008 4 27 April 2008 4 19992007 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 1band The mask is usually 1band 27 April 2008 5 27 April 2008 5 19992007 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 27 April 2008 6 27 April 2008 6 19992007 by Richard Alan Peters II 7 9 8 1 3 2 4 6 5 3 2 1 9 8 7 6 5 4 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 ....
View
Full
Document
This note was uploaded on 12/06/2011 for the course EECE 253 taught by Professor Alanpeters during the Summer '07 term at Vanderbilt.
 Summer '07
 AlanPeters
 Image processing, Frequency

Click to edit the document details