Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Cascade Training: killed and bad_alloc

Hi everyone,

I have OpenCV 2.4.7 installed on Amazon Linux (similar to Centos 6 - 64-bit). I've been following several tutorials online to create haar cascade classifier files, but have run into issues with both commands: opencv_traincascade and opencv_haartraining

In my experiments I have 40 positive images and 664 negative images (all cropped to w=300 h=100).

The tutorial used for generating samples etc. was found here: http://coding-robin.de/2013/07/22/train-your-own-opencv-haar-classifier.html

1) Command: opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 40 -numNeg 664 -w 300 -h 100 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024

Result: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted

2) Command: opencv_haartraining -data classifier -vec samples.vec -bg negatives.txt -nstages 20 -minhitrate 0.995 -maxfalsealarmrate 0.5 -npos 40 -nneg 664 -w 300 -h 100 -mode ALL

Result: Stuck at stage 0 and the script simply returns the word "Killed"

Any help of experience anyone can share would be greatly appreciated. Please also respond if you believe I need to supply more information. New to cascade training.

Thanks