2

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?

Dima
  • 38,860
  • 14
  • 75
  • 115
Nageshwar Saini
  • 145
  • 2
  • 8

1 Answers1

0

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.

Dima
  • 38,860
  • 14
  • 75
  • 115
  • Hi @Dima. I am using images of some of the gestures of the human hand like signalling left, right etc. Negative images I am using are extracted from a random video of my room with other objects in sight except the object(s) of interest. – Nageshwar Saini Feb 10 '14 at 15:56
  • Right now, as the following tutorial suggests, I am going to go for about 50 positive samples and 600+ negative samples. http://www.tuicool.com/articles/fqAFb2 – Nageshwar Saini Feb 10 '14 at 15:59
  • First, are you are training a separate detector for each gesture, correct? If not, you should be. And for each gesture you should include the other types of gestures as your negative images. – Dima Feb 10 '14 at 16:33
  • Yes, I am training a separate detector for each gesture. The problem is that the training starts commencing but halts (although last message is "Training is Complete") in between saying that it has fallen short of negative samples even if I am using as good as 30K samples for 500 positive samples. – Nageshwar Saini Feb 10 '14 at 16:55
  • I have edited the answer. I hope that clarifies things. Good luck! – Dima Feb 10 '14 at 18:28