The objective of the project is to use image segmentation to detect an object in an image. In this project the object was a bright pinkish-red barrel. Once the object is detected we had to identify the depth at which the barrel is located using the information from the training images.

I trained a Gaussian model with full covariance for each of the color classes. Using the connected object information I removed spurious noise and detected the depth. Depth was detected using the closeness of the detected major or minor axis length to the mean of the major or the minor axis length for the barrel of different depths.
The algorithm worked very well for most of the images. The detection was excellent in most of the situation but it failed in a few cases where objects of similar colors are present right next to the image or whenthey had reflections. It was not possible to eliminate the regions of unnatural shape as it would have affected the response to occluded objects. The depth detection worked exceedingly well in most cases except a few cases where the chosen bounding box was wrong as the image might have contained similar colored objects right next to the barrel.