Need help on trainCascade usage of mine
Hi All, I am trying to detect the banana using traincascade approach. positive sample-40(40*50 using createsample.exe )
+ive desc file looks like:
rawdata/1.bmp 1 180 154 494 161
rawdata/2.bmp 1 247 154 349 175
rawdata/3.bmp 1 133 118 488 141
Used the CreateSamples utility
createsamples -img Positive\rawdata\2.bmp -num 50 -bg bg.txt -vec data\positive2.vec -maxxangle 1.1 -maxyangle 1.1 -maxzangle 0.5 -maxidev 40 -bgcolor 0 -bgthresh 0 -w 24 -h 24
where i am passing 40 diff single +ive sample and creating 50*40 = 2000 samples
Negative 600 images and -ive desc looks like:
bg.txt :
Negative/1.bmp
Negative/2.bmp
Negative/3.bmp
after that using the mergevector.cpp.
using command
mergevec pos-neg.txt pos-neg.vec -w 24 -h 24
so my pos-neg.vec is having size of 2.19mb.
Utility used for Training
I am using
TrainCascade.exe -data Result -vec pos-neg.vec -bg bg.txt -numPos 1500 -numNeg 600 -w 24 -h 24 -featureType LBP -minHitRate 0.999 -maxFalseAlarmRate 0.5 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024
My console O/p of training:
C:\Banana>TrainCascade.exe -data Result -vec pos-neg.vec -bg bg.txt -numPos 1500 -numNeg 600 -w 24 -h 24 -featureType LBP
PARAMETERS:
cascadeDirName: Result
vecFileName: pos-neg.vec
bgFileName: bg.txt
numPos: 1500
numNeg: 600
numStages: 20
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: LBP
sampleWidth: 24
sampleHeight: 24
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
===== TRAINING 0-stage =====
<BEGIN
POS count : consumed 1500 : 1500
NEG count : acceptanceRatio 600 : 1
Precalculation time: 1.025
+----+---------+---------+
| N | HR | FA |
+----+---------+---------+
| 1| 1| 1|
+----+---------+---------+
| 2| 0.998| 0.215|
+----+---------+---------+
END>
OpenCV Error: Unspecified error (Invalid fs.state) in unknown function, file ..\..\..\src\opencv\modules\core\src\persistence.cpp, line 5271
Can Anyone Help me out where I am doing wrong. Any Help is appreciated.
Thank you.
and when i am using the C:\Banana>TrainCascade.exe -data Result -vec pos-neg.vec -bg bg.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000\ -numNeg 600 -w 24 -h 24 -mode ALL -precalcValBufSize 1024\ -precalcIdxBufSize 1024
I am getting :
PARAMETERS: cascadeDirName: Result vecFileName: pos-neg.vec bgFileName: bg.txt numPos: 1000 numNeg: 600 numStages: 20 precalcValBufSize[Mb] : 1024 precalcIdxBufSize[Mb] : 1024 stageType: BOOST featureType: HAAR sampleWidth: 24 sampleHeight: 24 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 1674252