Question: 1. Implement the N4 connected components algorithm . You should write code to label each black pixel with a number indicating to which N4 connected
1. Implement the N4 connected components algorithm . You should write code to label each black pixel with a number indicating to which N4 connected component it belongs. You should not use a built-in connected components algorithm. From this you should be able to determine the number of connected components in the image. You should also determine the coordinates defining the bounding box of each connected component.
2.Download the picture isri_5g.gif. This is a bilevel image, so black should be 1 and white 0. Some software loads the image backwards check your foreground and background pixel values. Text should be foreground. To display your connected component clusters, you should create a new image that is a gray (or color) image. Set the pixels that are off/0/white to white, and the black pixels each to a unique color corresponding to the component identification number. Use random not sequential colors. Draw a bounding box around each of the components.
3.Load the image skull.gif. Turn this into a binary image using a threshold of 128 (display such that the background is 0=white, and treat black as on). Rerun the connected components algorithm. How does the algorithm treat this image different than the text image? What is characteristically different between the CCs for the two images?
4.Expand your algorithm to find N8 connected components and rerun it. Point out the major differences in results from N4 and N8. Compare the number of times the backtracking algorithm runs for each case. Using MATLAB please solve these problems. Thanks in advance.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
