Ask Your Question

Revision history [back]

Error in opencv_traincascade

Hi can you please help me, I'm getting an error while running the opencv_traincascade on Ubuntu 14.04 from the following script

opencv_traincascade -data $AS/trainCascade -vec $AS/full_vec.vec -bg $AS/negative_copy.txt -numStages 20 -nsplits 2 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000 -numNeg 9000 -w 20 -h 20 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024 -mem 14000

the error it gives is
POS count : consumed 1000 : 1000 Train dataset for temp stage can not be filled. Branch training terminated. Cascade classifier can't be trained. Check the used training parameters.

Which I realise is the issue of the bg description file not being interpreted properly. My directory structure is


and my negative_copy.txt looks like


since in the documentation it's written that the address must be relative to the directory of the description file. But I've tried everything from ./, to /Negative to absolute addresses and my terminal is running from / just to ensure that my relative and absolute paths are same as well. Kindly help me. I am at wit's end.