I am using the connected component labeling algorithm in Matlab. Is it possible to use different color for different labels when showing the output? (Even though the labels have the same intensity).
Clarification:
I used connected component labeling algorithm to label the connected components of a binary images. Now I got different labels. All the labels contains pixel of equal intensity. (All the labels have pixel intensity value of 1) and all the labels appear in the same color. I want to display the different labels using different colors so that I can eliminate the unwanted one easier.
That is easy – use the
imagescfunction:If you already have a binary image, just use this section of the code: (
bis the image)You can also change the colors by using the
colormapcommand:In order to customize the colors, define an
nx3matrix, and give it as input tocolormap