Ask Your Question

Revision history [back]

You did not specify the -w and -h parameter for the traincascade interface and thus it uses the standard 24x24 dimensions. Those are not the same as your training data for the opencv createsamples utility. I suggest you to update your command to

opencv_traincascade -data sample/ -vec sample.vec -bg bg.txt -numPos 900 -numNeg 270 -featureType HAAR -mode ALL -w196 -h 106

You did not specify the -w -w and -h -h parameter for the traincascade interface and thus it uses the standard 24x24 dimensions. Those are not the same as your training data for the opencv createsamples utility. I suggest you to update your command to

opencv_traincascade -data sample/ -vec sample.vec -bg bg.txt -numPos 900 -numNeg 270 -featureType HAAR -mode ALL -w196 -h 106

So that it at least passes by these asserts. That being said, you also have a problem with dimensionality. For now you are using the standard 1024 MB of memory for the process, but with those dimensions and those number of samples, you will soon run out of memory. Search this forum for traincascade parameters to get a better insight in all of this.