I have 30 positive images and 60 negative images. When I tried to run haartraining with 4GB of memory and Quadcore processor, I get this error message:
OpenCV ERROR: Insufficient memory (Out of memory)
in function cvAlloc, cxalloc.cpp(111)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
The command I ran was:
./opencv-haartraining -vec vector/myvector.vec -bg negatives.txt -npos 24 -nneg 55 -mem 2048 -mode ALL -w 86 -h 150
The computer at test times was using less than 800 MB of memory, but during the execution of the above command, the memory used goes to more than 3GB and approximately 1GB of swap, all in less than 5 minutes of running the program.
Any suggestions of what can be done to solve this problem?