Summary:
Steps for Filtering in the Frequency Domain
1. Given an input image f(x,y) of size MxN, obtain the
padding parameters P and Q. Typically, P = 2M and Q = 2N.
2. Form a padded image, fp(x,y) of size PxQ by
appending the necessary number of zeros to f(x,y)
3. Multiply fp(x,y) by (-1)x+y to center its transform
4. Compute the DFT, F(u,v) of the image from step 3
5. Generate a real, symmetric filter function*, H(u,v), of
size PxQ with center at coordinates (P/2, Q/2)
*generate from a given spatial filter, we pad the spatial filter, multiply the expadded
6. Form the product G(u,v) = H(u,v)F(u,v) using array
multiplication
7. Obtain the processed image
8. Obtain the final processed result, g(x,y), by extracting
the MxN region from the top, left quadrant of gp(x,y)array by (-1)x+y, and compute the DFT of the result to obtain a centered H(u,v).