The purpose of this assignment is to implement and test the k-Nearest Neighbors (kNN) image smoothing technique. In class we described one algorithm to calculate the kNN:
You are welcome to use this algorithm or develop another method for averaging the K intensity values closest to the central pixel.
Your second task is to use your algorithm evaluation framework from the previous assignment to find the optimal values for K and N for removing 5%, 10% and 15% impulse noise from an input image. How does kNN perform compared to the two noise removal methods you evaluated in the previous assignment? What conclusions can you make?
Although kNN is conceptually a straigtforward algorithm, there are several tricky design decisions to make. Most importantly, how are you going to find the K values to average? Be careful to keep the "boundary cases" in mind when you come up with a solution (eg. what happens if the central pixel is the largest/smallest value in the NxN window).
You are welcome and encouraged to look at the implementation of the "Median" method when you are developing your solution. You are also welcome to use and/or adapt the "quicksort" function to locate the k-Nearest Neighbors.
My standard advice is to develop your code incrementally so you always have something that compiles and runs, 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. Save your testing output in text files for submission on the program due date.
When you have completed your program, write a short report (less than one page long) describing what the objectives were, what you did, and the status of the program. Does it work properly for all test cases? Are there any known problems? Save this report in a separate text 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, 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 in the department office. Include a title page which has your name and uaid, and attach your hand written design notes from above.