Friday, August 7, 2009

Color Image Segmentation

From the past activities, the separation of the region of interest (ROI) from the background image has been done using binary operations. This was proven to be a useful segmentation tool.

However, there are instances wherein the graylevels of the images overlap with that of the background. As an alternative technique, colors have been used to segment the ROI from the background. In fact, colors are used to divide images of the skin regions in face and hand recognition, land cover in remote sensing, and cells in microscopy.

Considering images of 3D objects, it can be observed that at different pixel locations, there are colors with different shades present within the object. To some extent, these shadows are seen as differing brightness levels of the same color. Thus, the color space can be represented by the parameters that can separate the brightness and chromaticity information. This color space is referred as normalized chromaticity coordinates (NCC).

NCC is expressed as the ratio of the individual RGB values and the sum of the RGB of the images. Mathematically, it is defined as:

where R, G, and B are the red, green, and blue color values of the image.

From the equations above, we can say that the values of r, g, and b are only between 0 and 1. Also, we do not need to derive b from the RGB since it can be obtained from r and g. This means that we can compress the 3D object image into its 2D form which makes the processing simpler. The figure below shows the r-g color space.

The different techniques that make use of the colors to segment images are the parametric and non-parametric methods. In parametric technique, the probability that a pixel belongs to a color distribution of interest is determined. This is done through the following steps:

  • From the 3D object, crop a ROI and determine its r and g values (see the equation above).
  • Calculate the mean μr μg and standard deviations σr σg.
  • Perform the equation below. Take note that the r in the equation is the r value of the image. This probability function is used to tag a pixel value whether it belongs to the ROI or not.
  • Execute the same equation for g of the image.
  • Multiply the probability p(r) and p(g).

In non-parametric technique, the 2D color histogram of the ROI is used to tag the membership of the pixels. Note that the histogram, when normalized, is equal to the probability distribution function of the color. To segment the image using non-parametric technique, the succeeding steps are followed:

  • From the 3D object, crop the ROI and determine its r and g values.
  • Get the 2D chromaticity histogram of the ROI. The sample code for 2D histogram is provided in the manual
  • Segment the images using backprojection. This is done by first determining the r and g values of the image and finding the position of each pixel in the histogram. After that, get the value of the histogram and use this to replace the pixel value of the image.

The following figures show the segmentation of different images using parametric and non-parametric techniques.


Figure 2. Segmentation of the image using parametric (2nd column) and non-parametric (3rd column) technique.

Figure 3. Segmentation of the images considering different color patch for parametric (2nd column) and non-parametric (3rd) column.


The results show that the segmentation of the images depend basically on the patch color that we choose and the number of bins of the histogram. The bright colors seen in the reconstruction of the images correspond to the pixels having close values with the pixel of the patch. As observed from the two technique, the segmentation is better if non-parametric technique is used. Proper choice of the number of bins yields good segmentation.


In this activity, I am giving myself a grade of 10 since the segmentation using the two techniques has been employed and yield desirable results.


I would like to thank Jica monsanto and Winsome Rara for helping me debug the code.


References:

1. Applied 186 Activity 12 Handout

2. http://blog.howdesign.com/content/binary/fwy.jpg

3. http://images.google.com.ph/imgres?imgurl=http://www.archimuse.com/mw2003/papers/rowe/rowefig1.jpg&imgrefurl=http://www.archimuse.com/mw2003/papers/rowe/rowe.html&usg=__mD2GEzAUoSQ5kK0tr5HFl4xoXpk=&h=288&w=322&sz=43&hl=tl&start=50&sig2=l-1KWXaLREY5nWbYBlEkXA&um=1&tbnid=VsWVB6-IgKvt4M:&tbnh=106&tbnw=118&prev=/images%3Fq%3D3D%2Bobject%2B%252B%2Bball%26ndsp%3D18%26hl%3Dtl%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26sa%3DN%26start%3D36%26um%3D1&ei=mXZ8SuSaGYqYkQXCydyNAw


No comments:

Post a Comment