Ask Your Question

Revision history [back]

OpenCV Training Custom Haar Cascade with Python 3

I am trying to train a haar cascade on my face. I have everything setup including the positive, negetive, the vec file, etc. but when I run the opencv_traincascade, it gave me a terminate called after throwing an instance of 'std::bad_alloc' error. Then I added this line to my arguments -nonsym -mem 512 and it gave me this error:terminate called after throwing an instance of 'std::logic_error'.

Here is the command I am running:

opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt\
>    -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000\
>    -numNeg 600 -w 80 -h 40 -mode ALL -precalcValBufSize 1024\
>    -precalcIdxBufSize 1024\
>    -nonsym\
>    -mem 512\

Any help would be greatly appreciated!