Ask Your Question

Revision history [back]

How to train correctly a cascade

Hi

I've been triying of training a cascade in OpenCV. My command line used is the next:

opencv_traincascade -data img/ -vec vecs/20x35.vec -bg imgNegative\bg.dat -numPos 1000 -numNeg 900 -numStages 12 -featureType HAAR -minHitRate 0.999 -maxFalseAlarmRate 0.5 -w 20 -h 35.

However, I got the nexto error:

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

I don't really know what happened. My vic file has 2000 positive samples. Any help, aid or tip will help me.

Thanks

How to train correctly a cascade

Hi

I've been triying of training a cascade in OpenCV. 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_traincascade -data img/ -vec vecs/20x35.vec opencv_createsamples -img imgPositive\10.jpg -bg imgNegative\bg.dat -numPos 1000 -numNeg 900 -numStages 12 -featureType HAAR -minHitRate 0.999 -maxFalseAlarmRate 0.5 -vec vecs\vec10.vec -w 20 -h 35.

35 -num 200

That step I complete it perfectly. My next step is running the traincascade. However, I got the nexto 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.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 HAAR -minHitRate 0.999 -maxFalseAlarmRate 0.5 -w 20 -h 35

I don't really know what happened. My vic file has 2000 positive samples. Any help, aid or tip will help I can do to fix it. I reviewed the official documentation several times. I want to know that information you need for helping me.

ThanksThanks.

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 HAAR -minHitRate 0.999 -maxFalseAlarmRate 0.5 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.

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.