Object Detection

In this project, our task was to make an algorithm that would detect the location in the image and distance to a barrel if given any picture of a red barrel. To do this, I wrote a Gaussian mixture model algorithm in MATLAB. I trained this algorithm on many images of red barrels that I hand-labeled myself. The features that I used were the pixel colors of the image, the GMM was trained to discern the specific color of the barrel from all other colors.

Once given an image, the model would make a prediction on each pixel whether or not it was part of the same barrel, producing a matrix of binary values the same size of the image. Then, using image post-processing, I would determine where the highest concentration of “barrel” pixels were located, and mark that as the location of the barrel. Using the size of the grouping of pixels, I was also able to determine the approximate distance the barrel was from the camera. The algorithm that I created was able to correctly determine the location of the barrel approximately 90% of the time, and the distance measurement was accurate to within approximately +/-10%.

Results of testing data are shown below. The green plus represents the algorithm’s prediction of where the barrel is, and the title displays the predicted distance: