In this activity, we color segment an image using parametric and non parametric segmentation.
For the non parametric segmentation, we did histogram backprojection wherein based on a color histogram of the ROI a pixel location is given a value equal to its histogram value in chromaticity space.
The parametric segmentation was done by assuming a gaussian pdf independently along r and g values of the ROI.
Since we are using 2D histograms, we first check if we are indeed getting the right colors.
Here the cropped portion is blue. Comparing our histogram with the chromaticity diagram below, we can see that the histogram is indeed correct. (I rotated the axis of the chromaticity so as to coincide with the histogram origin whichis at the upperleft corner.)
The results for the two methods are shown below.
A. Mugs
The image is
The cropped ROI is
For the non parametric segmentation, the result is
while for the parametric segmentation
B. Obama Lantern
The portion that I cropped is the light yellow part.
The result for the nonparametric was
For the parametric the pdf and the segmented image are
C. Starry Starry Night
The image is
The cropped color is
The non parametric segmentation result is
The parametric segmentation pdf and result is
We can see that the parametric segmentation is a lot stricter than the non-paramertic segmentation. Parametric would work better for when we want to segment shades of colors that are very much alike. For less stricter segmentations use non parametric.
In this activity, I give myself a grade of 10 because I understood and was able to do everything that was required.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment