Ask Your Question

rockbass2560's profile - activity

2016-04-14 20:20:49 -0600 received badge  Editor (source)
2016-04-14 15:42:33 -0600 commented question How to train correctly a cascade

Thanks Mathieu, I will review all info there.

2016-04-14 13:56:20 -0600 asked a question How to train correctly a cascade

Hi

I've been triying of training a cascade in OpenCV to identify mouths using LBP.

I cut the mouths of 10 images facial. The images look like as this:

image description

I decided to create 200 samples of each image and finally combine them using a python script.

My command line used in each image it is the next:

opencv_createsamples -img imgPositive\10.jpg -bg imgNegative\bg.dat -vec vecs\vec10.vec -w 20 -h 35 -num 200

That step I complete it perfectly. My next step is running the traincascade. However, I got the next error:

Train dataset for temp stage can not be filled. Branch training terminated. Cascade classifier can't be trained. Check the used training parameters

The command line used for that step is:

opencv_traincascade -data img/ -vec vecs/20x35.vec -bg imgNegative\bg.dat -numPos 1400 -numNeg 200 -numStages 12 -featureType LBP -w 20 -h 35

I don't know I can do to fix it. I reviewed the official documentation several times. I want to know that information you need for helping me.

Thanks.

ANSWER: I NEED TO INCREASE AMOUNT OF SAMPLES NEGATIVE AND POSITIVE. You need approximately of corpus of images 50% for positive samples, 30% for negatives and the rest for testing.