Question

I have to train as many as 20 haar classifiers. What I have is :

  1. Traditional command line method by compiling the cpp files provided in OpenCV distribution
  2. Cascade Training GUI in MATLAB

In the command line method, ObjectMarker interface is very less user friendly as compared to the ROI marking interface of CGT, MATLAB.

However, whenever I use CGT, MATLAB, even for a small sample of 250 positive images and 30000 negative images (both created using video files), it fails saying:

"Could not create sufficient samples, either decrease the False Alarm Rate, decrease the number of stages or increase the number of negative images."

The false alarm rate is already set to 0, i.e. equal number of +ve and -ve images to be used and the number of stages is already a very small value, i.e. 10. I am not able to get through this.

Those who have already created their classifiers that are working efficiently, please guide me :

  • Which approach out of the two should I use?

  • Is there any alternative to the approaches listed above?

Was it helpful?

Solution

What kind of objects are you trying to detect? And what kind of negative images are you using? Ideally, the negative images should be large images of scenes typically associated with your objects of interest.

Edit: Even if you are providing 30K negative images, the training may still not have enough negative samples. The trainCascadeObjectDetector function generates negative samples for each stage, by running the detector consisting of the stages it has so far on the negative images. If the detector detects any objects, they are by construction false positives, and they are used as negative samples for the next stage. Depending on what kind of negative images you supply, it may well be possible that after some number of stages, the current detector does not detect any false positives in the negative images.

You have said that your negative images come from a video of your room. The problem may be that all your negative images are too similar to each other. So you should probably try including other images among your negative set, to diversify it. Also you should make sure to include images containing hand gestures other than the one you are training for among your negative images.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top