S
S
Sergey2012-09-18 21:01:10
Image processing
Sergey, 2012-09-18 21:01:10

OpenCV: haartraining and memory leaks, what to do?

Actually prepared positive samples (about a hundred) and negative samples (two dozen). I generated vec files and was ready to start training the cascade, but that's bad luck.

haartraining -data haarcascade -vec samples.vec -bg negatives.dat -nstages 20 -nsplits 2 -minhitrate 0.999 -maxfalsealarm 0.5 -npos 97 -nneg 20 -w 180 -h 180 -nonsym -mem 512 -mode ALL


Running this command starts leaking memory. Despite the fact that I set the limit to 512 megabytes, after half a minute haartraining.exe eats up the required 2 gigabytes of RAM and throws an exception that it could not allocate more memory.

Actually, I know for sure that the parameters of the samples and their number could not affect this in any way. I came across reports that this is a bug with loading images, but it is also hard to believe that in 6 years the bug has not been fixed.

Hence the question - how to be?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question