The goal of this assignment is to create a two programs perform smoothing on an input image. The first program should calculate the average of pixels in a circular window to create an output image. The second program should use the local statistical properties in the input image to perform outlier removal. The requirements for these programs are described in detail below.
Image averaging is normally performed using a square windows centered on each output pixel. Although this is easy to implement, it does cause some problems because the four corner pixels are sqrt(2) further away from the center of the region than the four midpoints of the edges of the square. In particular, you will get different results if you rotate an image by 45 degrees than you would with the original image.
Your task is to create an averaging program that uses a circular averaging window. To implement this, you must include only the pixels that are less than or equal to R pixels away from the center pixel in your average calculation. To test your program, try averaging with 5x5 or 9x9 square windows using the "Average" command, and compare these results to your programs output with R=2 and R=4 respectively. You can use the "Subtract" method to create a difference image to look at.
The classic approach for outlier removal calculates the average pixel value in an NxN region centered on each pixel in the output image, and the pixel is kept if abs(input[y][x] - average) < threshold. The problem is that selecting this threshold depends on the intensity range in the image and often requires a lot of "trial and error" experiments.
Your task is to create an outlier removal program that uses a square NxN window centered on each output pixel to calculate the average and standard deviation of the pixels in this window. Using this information, you can detect outliers as pixels where abs(input[y][x] - average) > K * standard deviation. Outlier pixels should be replaced by the average value in the window, and non-outlier pixels should be the same value as the input image. To test your program, try several values for K and compare your input image to the output image using "Subtract" method again.
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.
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.
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.
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.