/Fourier-transform-on-images-in-matlab

Computing the Fourier transform of a given image and finding its magnitude and phase. and reconstruct the images after removing the low-frequency and high-frequency values

Primary LanguageMATLAB

Fourier-transform-on-images-in-matlab

In mathematics, a Fourier transform (FT) is a mathematical transform that decomposes functions depending on space or time into functions depending on spatial or temporal frequency, such as the expression of a musical chord in terms of the volumes and frequencies of its constituent notes. The term Fourier transform refers to both the frequency domain representation and the mathematical operation that associates the frequency domain representation to a function of space or time. [Wikipedia]

alt_text

Experimentations:

  1. Compute and show the Fourier transform of a given image "pout.tif" and its magnitude and phase. Also, display the reconstructed images from magnitude and phase.

  2. Take two images a cameraman.tif (A) and one of his picture pout.tif (B), then compute the magnitude and phase of Fourier transform of both images A and B, but reconstruct the images using (a) magnitude of A and phase of B, (b) magnitude of B and phase of A.

  3. Take an image (e.g., pout.tif), compute the Fourier transform, and reconstruct the images after removing the low-frequency and high-frequency values.

alt_text alt_text
cameraman.tif pout.tif

Experiment 1:

Compute and show the Fourier transform of a given image "pout.tif" and its magnitude and phase. Also, display the reconstructed images from magnitude and phase.

Results:

alt_text alt_text alt_text alt_text
Take FFT (what? there is just nothing left!) Shift the FFT (oh, there is a small white dot!) Scale it up (It’s actually a star!) Take inverse FFT (Bring the girl back!)

That girl is a star in a different domain!

Experiment 2:

Take two images a cameraman.tif (A) and other image pout.tif (B), then compute the magnitude and phase of Fourier transform of both images A and B, but reconstruct the images using (a) magnitude of A and phase of B, (b) magnitude of B and phase of A.

Results:

alt_text alt_text alt_text alt_text
pout.tif (A) FFT (A) FFT (magnitude of A, phase of B) image (magnitude of A, phase of B)
alt_text alt_text alt_text alt_text
cameraman.tif (B) FFT (B) FFT (magnitude of B, phase of A) image (magnitude of B, phase of A)

Experiment 3:

Take an image (e.g., pout.tif), compute the Fourier transform, and reconstruct the images after removing the low-frequency and high-frequency values.

Results:

alt_text alt_text alt_text
Filter 1 FFT after applying Filter 1 Image (removing high frequencies)
alt_text alt_text alt_text
Filter 2 FFT after applying Filter 2 Image (removing low frequencies)