Ask Your Question

Revision history [back]

Why does opencv_traincacade.exe crash

Hi All,

I have a collection of 1947 positive images, and 2279 negative images stored in proper structure. I run the opencv_createsamples.exe successfully and it generated a file "positives.vec". When I then ran the opencv_traincascade.exe, it ran for a while, output some info (please see below) and then crashed without any useful information.

Please help!

Any help or pointer is highly appreciated.

Thanks,

Tuc


Computer spec:

  • Processor: Intel i7 CPU Q720 @1.60Hz
  • Installed Mem: 16.0 GB
  • System Type: 64-bit Operating System
  • OS: Windows 7 Professional Service Pack1

Command used to create samples:
opencv_createsamples.exe -info "C:\training\haar_training\positives.txt" -vec "C:\training\haar_training\positives.vec" -num 1947 -w 24 -h 24

Command used for cascade training:
opencv_traincascade.exe -data C:\training\haar_training\ -vec C:\training\haar_training\positives.vec -bg C:\training\haar_training\negatives.txt -minHitRate 0.95 -maxFalseAlarmRate 0.4 -numPos 1947 -numNeg 2279 -w 24 -h 24 -mode ALL

Console output after the cascade training command:
PARAMETERS:
cascadeDirName: C:\training\haar_training\
vecFileName: C:\training\haar_training\positives.vec
bgFileName: C:\training\haar_training\negatives.txt
numPos: 1947
numNeg: 2279
numStages: 20
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: HAAR
sampleWidth: 24
sampleHeight: 24
boostType: GAB
minHitRate: 0.95
maxFalseAlarmRate: 0.4
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL

===== TRAINING 0-stage =====
BEGIN
POS count : consumed 1947 : 1947
NEG count : acceptanceRatio 2279 : 1
Precalculation time: 5.153

+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 1| 1|
+----+---------+---------+
| 3| 1| 1|
+----+---------+---------+
| 4| 1| 0.989908|
+----+---------+---------+
| 5| 1| 0.989908|
+----+---------+---------+
| 6| 1| 0.996051|
+----+---------+---------+
| 7| 1| 0.998245|
+----+---------+---------+