Tuesday, September 21, 2010

A13 – Color Image Segmentation

In some cases, you may only want to select a particular portion on an image where you would be performing image processing. One way of selecting that said portion would be to use color cues. In this activity, we would learn how to select only a particular color(ROI - region of interest) in an image. This is done through color segmentation.

There are two types of image segmentation which we would be doing:

1. Parametric: where we would assume the ROI to have a Gaussian PDF in the r and g values and segment the whole image using this PDF.

2. Non-parametric segmentation: where we would obtain the 2D histogram of the ROI and use the this histogram to segment the image using histogram backprojection

where r and g are the normalized chromaticity coordinates given by:

r = R/R+G+B, g = G/R+G+B

recall:

Histogram backprojection: a technique where using the color histogram, a pixel location is given a value equal to its histogram value in chromaticity space. (see activity 8)

Given the image:


Figure 1: Image to be segmented

What I want to do is to just select the rose. (ROI = rose)

Parametric


Figure 2: Result using parametric color segmentation

White pixels represent the present of the cue color while black pixels represent absence of the cue color. Using parametric color segmentation, we were able to select most parts of the rose. :D

Non-parametric

First, we get the histogram of the ROI. This is basically the same as getting the histogram for a gray image except that this time, the plot would be 3D -1 dimension for each color band(RGB).


Figure 3: Histogram of ROI


Figure 4: Result using non-parametric color segmentation

If I am to compare the two results, I would say the parametric color segmentation is ideal for selecting object with parts having slightly different colors. While non-parametric color segmentation should be used for selecting a specific color.

I would like to give myself a grade of 9/10 for this activity. I was able to get the results asked for but failed to blog this activity in a more detailed way.

No comments:

Post a Comment