Ask Your Question

stephenc's profile - activity

2016-12-10 23:08:42 -0600 received badge  Editor (source)
2016-12-10 23:07:06 -0600 commented question Problem with Cascade Classifier

Is the cascadeclassifier trained correctly? I keep getting the same error on around stage 2 or 3 generally. Can you figure out why that error is happening? What opencv_traincascade are you using? Are you using a pre-compiled one, or one you built yourself?

2016-12-10 22:48:56 -0600 commented question Problem with Cascade Classifier

Still, it shouldn't detect everything on the screen right? Why would that happen?

2016-12-10 22:47:26 -0600 received badge  Supporter (source)
2016-12-10 22:47:00 -0600 commented question Opencv_traincascade failing on precalculation for negatives

Thanks! Unfortunately, that question doesn't help me answer mine.

2016-12-10 12:21:52 -0600 asked a question Opencv_traincascade failing on precalculation for negatives

I have tried several times now to use opencv_traincascade (using vc12 and vc11 from Windows build), but I keep running into the error:

BEGIN

POS count : consumed 40 : 40

Train dataset for temp stage can not be filled. Branch training terminated.

What is odd is that this error seems to occur at different stages. I have tinkered with my command, varying a number of the different parameters and the one that results in the most change is varying -numNeg. The more I reduce -numNeg, the higher number of stages will be computed.

So, I started to suspect that maybe I had an issue with end of file and I just needed to lower the number of negatives to be: totalNumNeg (297) / desiredNumStages.

So, I tried lowering the -numNeg to 5. With -featureType LBP I was able to get through 9 stages and successfully complete, but the final NEG cont : acceptance Ratio was 5 : 0.185185 (command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 10 -numPos 40 -numNeg 5 -w 112 -h 20 -featureType LBP)

Then, for kicks and giggles I tried to do -featureType HAAR with the same parameters otherwise. This time it only made it through stage 2. The NEG count : acceptanceRatio was 5 : 0.0202429 on Stage 2. (command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 10 -numPos 40 -numNeg 5 -w 112 -h 20 -featureType HAAR)

Since, I didn't change the -numNeg and it still failed using HAAR instead of LBP, that leads me to believe that it has something to do with the acceptanceRatio. Is it possible that I am hitting a weird error after achieving some level of accuracy?

Only once, I got this finish instead: BEGIN POS count : consumed 40 : 40 NEG count : acceptanceRatio 4 : 0.025 Required leaf false alarm rate achieved. Branch training terminated.

with the command: opencv_traincascade.exe -data C:\Training\data -vec C:\Training\titles.vec -bg C:\Training\negatives.txt -numStages 5 -numPos 40 -numNeg 45 -w 112 -h 20 -featureType LBP

Any advice would be greatly appreciated. Urgency is appreciated. I have spent every free moment this week trying to get this working and my final project is due next Friday. Thanks!