Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Image File 2. http://postimg.org/image/ktukh16nf/ Download the image from the as

ID: 3551017 • Letter: I

Question


Image File


2. http://postimg.org/image/ktukh16nf/

Download the image from the assignment link. Write a program that is able to complete the following actions: Apply Fourier transformation to the 'lenaG.tif image and display the magnitude and phase images of the Fourier coefficients. Save the both images of the Fourier coefficients into separate images. Apply a highpass filter to the Fourier coefficients of the 'lenaG.tif and reconstruct the filtered image using the inverse Fourier transform. Save the reconstructed image (after the Fourier transform.) Note: by varying the cutoff frequency, you can get different results. Adjust the cutoff frequency of the highpass filter so that the reconstructed image gives the minimum difference to the result of applying the Sobel edge detector on the 'lenaG.tif image. Print out the difference value (subtract the two edge maps.) Apply a band-reject filter (centered at the half of the maximum frequency point and the width of the rejected band is 20 pixels) to the Fourier transform of the 'lenaG.tif and reconstruct the filtered image using the inverse Fourier transform. Save the reconstructed image (after the Fourier transform.) The program must be implemented with openCV. Put all your code in ONE program file. Submit the source code of your program and the output images and the ASCII file. Within the program, use comment lines to describe how to execute the program to demonstrate the successful completion of the above actions. Fail to include descriptive comments will receive 5 point deduction.

Explanation / Answer

// Load an image cv::Mat inputImage = cv::imread(argv[argc-1], 0); // Go float cv::Mat fImage; inputImage.convertTo(fImage, CV_32F); // FFT std::cout