Normally we use thresholding in order to separate a specific object from its background. However when the object has the same gray-level value as the background, this can be be a problem. Instead we use the difference in color information in order to separate the background and foreground. 3-D images will have shading variations so the segmentaion needs to be done irregardless of the brightness of the color. This can be done using a color space that separates brightness and color information such as the normalized chromaticity coordinates:
where:
Using this color space, it can be observed that R+G+B = 1 so we can have B = 1-R-G. with this we can have a 2-D color coordinate plus the intensity information which makes segmentation easier.
In this activity, we will use two techniques in order to segment an object from the background.
First we obtain an image containing our region of interest:
where our region of interest is:
The first of the two techniques is the parametric probability distribution estimation. First we obtain the mean and standard deviation of the R and G coordinates of the region of interest. and then plugging them into the equation:
where r is either the green or red color information of the whole image, then after thresholding, we obtain the image:
The other technique is histogram back propagation. We create the histogram of the region of interest:
Then using this histogram to eliminate the colors not in the histogram we obtain:
If we look quality wise, parametric probability distribution estimation is better that histogram propagation. It is also easier to use.
This activity is not that hard and although I hate histogram manipulation, having the code in 1-D from the previous activity made it a lot easier to extend into 2-D. I give myself a 9/10 for this activity.