I am trying to train a cascade classifier using OpenCV, a tutorial & UIUC Image Database for Car Detection. However, the training 'hangs' at stage 0 and never generates any files; in the tutorial, results are seen in a matter of minutes.
I am running OpenCV 2.4.8, which I have installed using conda, on a 2015 MBP running Yosemite (10.10.5)
Steps:
- Downloaded the dataset & saved the positive images in a pos folder and the negative images in a neg folder
generated a txt file for the positive images
find pos -iname "*.pgm" > cars.txt sed -i '' 's/.pgm/.pgm 1 0 0 100 40/g' cars.txt
generated a txt file for the negative images
find neg -iname "*.pgm" > bg.txt
generated a vec file from cars.txt
opencv_createsamples -info cars.txt -num 550 -w 48 -h 24 -vec cars.vec
create a
data
dirmkdir data
train cascade
opencv_traincascade -data data -vec cars.vec -bg bg.txt -numPos 500 -numNeg 500 -numStages 2 -w 48 -h 24 -featureType LBP
Output:
PARAMETERS:
cascadeDirName: data
vecFileName: cars.vec
bgFileName: bg.txt
numPos: 500
numNeg: 500
numStages: 2
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: LBP
sampleWidth: 48
sampleHeight: 24
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 500 : 500
NEG count : acceptanceRatio 500 : 1
I have waited for several hours but the training never progresses nor does it generate any files in my data
directory. What is causing the 'hanging'?