MATLAB: Need code which created ‘stopSigns.mat’

code used to create stopsigns.matComputer Vision Toolbox

Using Computer Vision system toolbox i'm trying to detect bottles in an image. For that I want to train Computer Vision System toolbox with "trainCascadeObjectDetector" function. I also analysed the example program "Train a Stop Sign Detector"
But the problem is i'am stuck at one point, that is, for my application how to create and load positive samples data from "bottles.mat" file, which is same as "stopSigns.mat"
Can any-one crack the issue, or is there any alternate way to train Computer Vision System Toolbox without using .mat file for positive samples data input.

Best Answer

You don't really need a mat file. You need ground truth data for training. So, you need a set of images with bottles in them and bounding boxes for the bottles in the images.
The mat file just contains an array of structs specifying the name of the image file and the bounding box of the bottle in that image.
The mat file is just used to pass the positive instances input argument to the trainCascadeObjectDetector function.
Hope that helps!