Given a set of training images in the folder Train with the file names as the distance to the barrel in meters, locate all the barrels and find the distance to them from the camera in each Test image.
- Run
Wrapper.m
- Change ColorSpace by changing
ColorSpace
variable to any one ofRGB
orYCbCr
oryRb
. The code thresholds currently work for YCbCr. - To train, Set
TrainFlag = 1
, switched off by default. - If you have any questions or queries feel free to raise an issue.
You can find the report here.
Yellow highlights show the candidate red regions and green highlights show the candidate red barrel regions.
- Oriented Bounding Box http://www.mathworks.com/matlabcentral/fileexchange/30402-feret-diameter-and-oriented-box/content/imFeretDiameters/imFeretDiameter.m
- Ellipsoid Plotting http://www.mathworks.com/matlabcentral/fileexchange/13844-plot-an-ellipse-in--center-form-
- Entropy rate segmentation http://www.merl.com/publications/docs/TR2011-035.pdf