The goal of this homework assignment is to apply multi-scale edge detection and image segmentation to the problem of road detection. You will be given a collection of road images, and your task is to apply different edge detection and image segmentation algorithms with different parameters to select which parameters produce the best results for typical input images.
Smoothing: Roads are relatively large objects in typical images, so it makes sense to smooth images before applying edge detection or image segmentation. Write a program to apply N levels of Gaussian smoothing with increasing sigma values to your input image. Your program should take a starting sigma value and use some sort of formula to create N-1 additional sigma values. Try a variety of starting values and forumlas to get a collection of images ranging to 'not very blurred' to 'significantly blurred'.
Edge Detection: The libim library contains three classic edge detection methods: GradientEdges, LaplacianEdges and CannyEdges. Extend your program to call these edge detection methods on your smoothed images with a range of threshold values to see how they work. You may find that threshold values that work well for one level of blurring may perform poorly for a higher/lower level of blurring. See if you can make your thresholds a function of blurring level or a function of the dynamic range of gradient magnitude values in your image. For each of your input images, record the combination of blurring sigma and edge threshold that you feel works the best.
Image Segmentation: The libim library contains three classic image segmentation methods: Threshold, RegionGrow, and Watershed. The Threshold method has one parameter which is the intensity threshold and outputs a binary image (0 < threshold, 1 > threshold). The RegionGrow method takes an (x,y) coordinate and an intensity difference threshold as inputs and outputs a binary image (1 = region, 0 = background). Finally, the Watershed method has one parameter with a range of [0..1] that controls the segmentation process (smaller values yield more watershed regions). Extend your program to call each of these methods with a range of parameter values to find the combinations that work best for finding the road region.
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 documents, and save your testing output in text files for submission on the program due date.
When you have completed your C++ program, write a short report (1-2 pages 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, 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 teaching assistant in your next lab. Include a title page which has your name and uaid, and attach your hand written design notes from above.