Description
In this project each student must implement thinning, branchpoint and endpoint detection
to recognize letters in an image of text.
This lab builds upon the previous lab and should use part of its result along with the same
original materials:
parenthood.ppm input image
parenthood_e_template.ppm template image
parenthood_gt.txt ground truth
msf_e.ppm your result from matched spatial filtering
Your result from matched spatial filtering should be stored in a ppm image and available
for reading for this lab.
Your program should perform the following steps:
1. Read the input image, your msf image, and ground truth file.
2. Loop through the following steps for a range of T:
a. Loop through the ground truth letter locations.
i. Check a 9 x 15 pixel area centered at the ground truth location. If
any pixel in the msf image is greater than the threshold, consider
the letter “detected”. If none of the pixels in the 9 x 15 area are
greater than the threshold, consider the letter “not detected”.
ii. If the letter is “not detected” continue to the next letter.
iii. Create a 9 x 15 pixel image that is a copy of the area centered at
the ground truth location (center of letter) from the original image.
iv. Threshold this image at 128 to create a binary image.
v. Thin the thresholded image down to single-pixel wide components.
vi. Check all remaining pixels to determine if they are branchpoints or
endpoints.
vii. If there are not exactly 1 branchpoint and 1 endpoint, do not
further consider this letter (it becomes “not detected”).
b. Count up the number of FP (letters detected that are not ‘e’) and TP
(number of letters detected that are ‘e’).
c. Output the total TP and FP for each T.
Using any desired program, you must create an ROC curve from the program output.
You must write a brief report that includes the code and the ROC curve. Show an
example of your image copy after thresholding (step iv above), the thinned image (step
v), and the detection of branchpoints and endpoints (step vi). In order to be clearly
visible you can use color or overlay symbols to highlight the detected branchpoints and
endpoints. Identify the optimal T and its corresponding FP and TP values.
Submit your C-code (as an attachment) and report (as an attachment) to
ece_assign@clemson.edu. Use as subject header ECE4310-1,#3 or ECE6310-1,#3. This
email is due by midnight of the due date.