CSCE 5683 - Homework 3
Due Date - 10/19/2012 at 11:59 PM

1. Problem Statement:

The goal of this assignment is to gain experience with image processing in the frequency domain. Your first task will be to add distortion to an image by changing the amplitude or phase of a small number of Fourier coefficients. Your second task is to smooth an image by removing all Fourier coefficients above a given frequency. The requirements for these programs are described in detail below.

2. Design:

Image Distortion

When you take the Fourier transform of an NxM input image f(x,y), you will obtain an NxM image F(u,v) containing the Fourier coefficients for this image. Your task is to add distortion to R random locations in F(u,v). Here you have two choices:

  • amplitude distortion - multiply amplitude of F(u,v) by a scale factor S. To do this you have to select R random (u,v) locations in the Fourier image and multiply the values of F(u,v).re and F(u,v).im by S.

  • phase distortion - change the phase of F(u,v) to be equal to zero, while keeping the amplitude unchanged. To do this, you need to select R random (u,v) locations in the Fourier image and calculate the amplitude of F(u,v). Then save this value in F(u,v).re, and set F(u,v).im to zero.

    When you do the inverse Fourier transform, your image may have visible distortion depending on your values for R and S. To better see this distortion, you can use the "Subtract" method to create a difference image to look at.

    Image Smoothing

    When you take the Fourier transform of an NxM input image f(x,y), you will obtain an NxM image F(u,v) containing the Fourier coefficients for this image. To perform smoothing, you need set some of the "high frequency" F(u,v) coefficients to zero.

    To do this, you need to calculate the frequency associated with every (u,v) position in the Fourier image. This is done by calculating the Euclidean (or city block) distance from (u,v) to the "nearest corner of the image". Once you have calculated d, you keep the F(u,v) values with a distance less than a pre-defined distance D, and you set F(u,v) to zero when the distance d is greater than D.

    When you do the inverse Fourier transform, your image may have visible smoothing depending on your value for D. To better see this smoothing, you can use the "Subtract" method to create a difference image to look at.

    3. Implementation:

    You can implement this program using either a bottom-up approach or a top-down approach. If you go for a bottom-up approach, start by creating basic methods and classes, and test theses methods using a simple main program that calls each method. When this is working, you can create the main program that uses these methods to solve the problem above.

    If you go for a top-down approach, start by creating your main program that reads user input, and calls empty methods to pretend to solve the problem. Then add in the code for these methods one at a time. This way, you will get an idea of how the whole program will work before you dive into the details of implementing each method and class.

    Regardless of which technique you choose to use, you should develop your code incrementally adding code, compiling, debugging, a little bit at a time. This way, you always have a program that "does something" even if it is not complete.

    4. Testing:

    Test your program to check that it operates correctly for all of the requirements listed above. Also check for the error handling capabilities of the code. Try your program on 2-3 input images, and save your testing output for submission on the program due date.

    5. Documentation:

    When you have completed your C++ program, write a short report (2-3 pages long) describing what the objectives were, what you did, and the status of the program. Include sample input/output images to illustrate how the code works. Does it work properly for all test cases? Are there any known problems? Save this report in a separate file to be submitted electronically.

    6. Project Submission:

    In this class, we will be using electronic project submission to make sure that all students hand their programming projects and labs on time, and to perform automatic analysis of all programs that are submitted. When you have completed the tasks above go to the class web site to "submit" your documentation, C++ program, and testing files.

    The dates on your electronic submission will be used to verify that you met the due date above. All late projects will receive reduced credit (50% off if less than 24 hours late, no credit if more than 24 hours late), so hand in your best effort on the due date.

    You should also PRINT a copy of these files and hand them into your instructor your next class. Include a title page which has your name and uaid, and attach your hand written design notes from above.