## EEGR6118 PROJECT

• Project 3

This project explores methods of image segmentation.

• Organize into groups of 1 or 2. Students unfamilair with C or C++ should join groups having at least one person familiar with C or C++. Students who are unable to find a group will be randomly assigned.

• Keep explanations to 2 or 3 sentences written directly on the printout of the results. Write your explanations directly on the printout; 2 or 3 sentences should suffice for most explanations.
• Use "snapshot" for printouts
• Note "xmag" is a useful utility, try running it.

Part 1

• Load spwheel.img and print it out.
• Implement a mean or average filtering of the image using a 3x3 mask as in Fig. 4.21(a). Plot the result for spwheel.img.
• Implement median filtering of the image using a 3x3 neighborhood as described on page 191. Plot the result and comment on the relative performance of this filter near edges for spwheel.img.
• Implement the magnitude of the gradient using the square root of the sum of the squared outputs using Sobel operators. Plot the result for wheel.img.
• Plot the gradient of rect17.img
• Using the above gradient operator, apply a threshold to the gradient of the f16 image that removes most of the mountain clutter but retains most of the f16 boundary. It would be best to implement the threshold as and adaptive adjustment depending on some function keys (perhaps one key increases it, the other decreases). The output should be black below threshold, and white above. Plot the result, and give the threshold used.
• Using the above gradient operator, apply a threshold to the gradient of the camera image that removes most of the background but retains most of the man and tripod. Plot the result, and give the threshold used.

Part 2

• Load ranran1.img and print it out.
The image contains 2 Gaussian-distributed objects: elipse with mean 160, std dev 32, and background with mean 120, std dev 35.
• Segment ranran1.img using the optimum Gaussian threshold from Eq. 7.3-12, assuming P1=P2. Plot this segmentation with segmented regions as black and white.
Show the computation of the optimum threshold on a separate sheet of paper.
• Segment ranran1.img using the optimum Gaussian threshold from Eq. 7.3-12, this time estimating P1 and P2.
Show your estimates for P1 and P2, and show the computation of the optimum threshold on another sheet of paper.
• Formulate a strategy to more effectively segment ranran1.img (without all the misclassifications). Implement this strategy and plot your results. On the printout make sure to describe your strategy and method.

Part 3

• Implement a region-growing segmentation on camera.img.
As the seed for the segmentation, use a 3x3 neighborhood at (x,y) = (150,64) at a point 150 pixels from the top of the image, and 64 pixels from the left of the image.
• For the region grower, add neighboring pixels to the region if they fall within +/- k gray-levels of the nearest neighbors in the region. Consider using 8-neighbors for this.
• Adjust the value of k until as much of the man as possible is segmented from the background. Plot your best results with the background as white and with the segmented (man) region as black.
Show the threshold k that you used, on the printout.

Part 4

• Segment two of the following images:
1. nd15d77.img
Segment into 3 regions, one for each texture.
Color code the three regions after segmentation as black, white, and gray.
Print the original image, final segmentation, and any important intermediate results.
2. fprint1.img
Segment into 2 regions.
One region should be a white background, the second region should be a single pixel wide line outlining the "ridge" of the fingerprint. The line should be 8-connected.
Print the original image, final segmentation, and any important intermediate results.
3. heart1.img
Segment into 3 regions, heart chamber, heart valve, and the remainder of the image (background).
Color code the three regions after segmentation as black, white, and gray.
Print the original image, final segmentation, and any important intermediate results.
• On a single sheet of paper for each segmentation, document the approach taken for the two segmentations that you choose. Include:
1. A simple (2-10 block) block diagram of the processing steps. For example, one block could be Sobel gradient, followed by a thresholding block.)
2. A short paragraph explaining the approach and steps taken, not to exceed more than 1/2 page handwritten.

Report

Write a cover sheet ONLY!!! Do not write any discussion, except directly on the printout of the results. I will only look on the printouts for any discussion. All extraneous material WILL BE IGNORED!
Do not add extraneous pages or put explanations on separate pages unless specifically directed to do so.
Turn in all source code at the end of the report.