Color Image Segmentation
Image segmentation is a process in which a region of interest(ROI) is selected and isolated from the image so that further things can be done on it. This is done by using the unique features of the region of interest to distinguish it from the insignificant parts.
For grayscale images, image segmentation can be done through thresholding. But this could not be done for other types of images. One feature that was used to segment some images is its color but this is sometimes problematic since 3D objects have varying shades of the same color because of the shadow formed by light. So it is better to utilize something that can divide brightness and color information.
Normalized chromaticity coordinates or NCC is a color space that can separate brightness and color information.
Image segmentation that uses the color as a distinguishing feature is used by finding the probability that a pixel falls within a distribution of interest. This can be done in two ways, parametric segmentation and non-paramagnetic segmentation.
Parametric segmentation derives the Gaussian Probability Distribution Function (PDF) of the r and g values for the ROI then segments the whole image. Non-parametric segmentation obtains the histogram of the ROI first, and then the histogram itself is used to segment the image using histogram projection.
In this activity we would perform both color-based segmentation on an image and compare the results. First, I selected this image of the National Basketball Association (NBA) trophy.
|
Figure 1. Image of the NBA trophy (source:http://nba-news-alex.blogspot.com/2011_02_01_archive.html)
I cropped a part of it and saved the image.
Figure 2. Cropped part from the image in Figure 1
Then I performed parametric segmentation on it using Scilab. The code is shown below.
Here the RGB values are transformed to NCC then we obtain the probability that a pixel with color r belongs to ROI. To do this we obtained the mean and standard deviation of the r and g for the Gaussian PDF. Then we obtained their joint probability by multiplying their individual probability. The result is shown in figure 3.
|
Figure 3.Parametric segmentation for the NBA trophy
|
Next thing I did is perform nonparametric segmentation on the image. First we obtain the 2D histogram of the r and g values using Scilab. The code is shown below:
The output of this is shown below:
Figure 4. 2D histograms of the r and g values of the ROI
Then this is rotated for the NCC.
Figure 5. Rotated image of figure 4.
Figure 6. Normalized Chromacity space
. Using the histogram we performed histogram backprojection using Scilab. The code is shown below.
The resulting image from non-parametric segmentation is shown below.
Figure 7. Non-parametric segmentation of the NBA trophy
Looking at both images it can be seen that the parametric segmentation was able to yield the better result compared to non-parametric segmentation. In non-parametric segmentation, some of the background were segmented together with the ROI while in parametric segmentation, the edges are well-defined.
I would give myself a grade of 9/10 for doing this on my own.
References 1. Soriano, Color Image Segmentation 2011, Applied Physics 186
|
Walang komento:
Mag-post ng isang Komento