Ask Your Question

gsgrebe's profile - activity

2013-11-12 23:57:55 -0500 received badge  Editor (source)
2013-11-12 23:56:52 -0500 asked a question traincascade exits early, no error

Hi everyone,

Im working on training a HAAR based cascade classifier using a large database of eye images and the opencv_traincascade app from OpenCV v2.3.1.

So far I have created all the necessary files including the .vec file of positive samples and the .txt file of the background samples.

To start I was trying I'm trying to only 6000 positive samples and 6000 negative samples and was setting the number of stages to 20. This seemed reasonable to me given the size of the data but so far it has not been working.

The two problems i've experienced so far are:

  1. The training has been freezing very early on in the process where it starts going a few stages but then seems to hang at the very beginning of a stage before outputting "NEG count : consumed ..." and I cant really tell if it is still working or stuck.

  2. The training starts a stage and keeps going through some high number of iterations (anywhere from 20 - 50) but then exits all together without any kind of message. Because of this it never actually compiles all the separate stages into a single cascade.xml file (and even if it had this usually occurs around stage 2 or 3)

Does anyone have any ideas as to what might be happening?

right now my commands are:

opencv_traincascade.exe -data cascade1 -vec pos.vec -bg bg.txt -numPos 6000 -numNeg 6000 -numStages 20 -featureType HAAR -w 24 -h 24

Everything else I just left as the default options which I'm sure have some influence but I was expecting to get past the first couple of stages especially with more training data