Python Prgogram to find the DFT of an Image
Required packages/ library : Open CV, Numpy, matplotlib.
Program Str.
- import library
- get the input image and covert to gray scale
- Transform the image to improve the speed in the FT calculation
- Calculate the DFT
- output of CV2.dft() function will be 3-D numpy arry, for 2-D Output, 2D DFT as two part complex and real part. so need to convert as we required.
- Reconstruct the image using the inverse Fourier transform
- Displayling input image, Gray Scale image, DFT of the Input Image
#For Run the Program
Open the DFT_Image done.py in your Python IDE.
Give the Path of your Input image.
and run the program.