I'm following the example of: link
Almost everything has gone well, in the part where I fail is when I execute the last step, when I try to create the .xml file that will help me detect my own objects:
opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000 -numNeg 600 -w 80 -h 40 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024
When I execute it, it tells me the following:
PARAMETERS:
cascadeDirName: classifier
vecFileName: samples.vec
bgFileName: negatives.txt
numPos: 1000
numNeg: 600
numStages: 20
precalcValBufSize[Mb] : 2048
precalcIdxBufSize[Mb] : 2048
stageType: BOOST
featureType: HAAR
sampleWidth: 80
sampleHeight: 40
boostType: GAB
minHitRate: 0.999
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL
===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 1000 : 1000
NEG count : acceptanceRatio 600 : 1
OpenCV Error: Insufficient memory (Failed to allocate 2147481604 bytes) in OutOfMemoryError, file /build/buildd/opencv-2.3.1/modules/core/src/alloc.cpp, line 52
terminate called after throwing an instance of 'cv::Exception'
what(): /build/buildd/opencv-2.3.1/modules/core/src/alloc.cpp:52: error: (-4) Failed to allocate 2147481604 bytes in function OutOfMemoryError
I have 3 GB of RAM on my PC, from which always when executing this command I close all the programs, leaving 2 GB of free RAM, but even then I am saved from this error.
If you know otherwise to create the haar cascade, you can show me, I am open to any alternative that you show me.