Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Need help on trainCascade usage on 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

1.CreateSamples

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 imags: -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.

2.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.

Need help on trainCascade usage on 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

1.CreateSamples

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 imags: -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.

2.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.

Need help on trainCascade usage of mine

Hi All, I am trying to detect the banana using traincascade approach. 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

1.CreateSamples

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

24

where i am passing 40 diff single +ive sample and creating 50*40 =2000 = 2000 samples

Negative 600 imags: images and -ive desc looks like: like:

bg.txt :

Negative/1.bmp
Negative/2.bmp
Negative/3.bmp

Negative/3.bmp

after that using the mergevector.cpp.

using command

mergevec pos-neg.txt pos-neg.vec -w 24 -h 24

24

so my pos-neg.vec is having size of 2.19mb.

2.for Training i Utility used for Training

I am using using

TrainCascade.exe -data Result -vec pos-neg.vec -bg bg.txt -numPos 1500 -numNeg 600 -w 24 -h 24 -featureType LBP
LBP -minHitRate 0.999 -maxFalseAlarmRate 0.5 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 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: PARAMETERS:

cascadeDirName: Result

Result vecFileName: pos-neg.vec

pos-neg.vec bgFileName: bg.txt

bg.txt numPos: 1500

1500 numNeg: 600

600 numStages: 20

20 precalcValBufSize[Mb] : 256

256 precalcIdxBufSize[Mb] : 256

256 stageType: BOOST

BOOST featureType: LBP

LBP sampleWidth: 24

24 sampleHeight: 24

24 boostType: GAB

GAB minHitRate: 0.995

0.995 maxFalseAlarmRate: 0.5

0.5 weightTrimRate: 0.95

0.95 maxDepth: 1

1 maxWeakCount: 100

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="">

<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, ..\..\..\src\opencv\modules\core\src\persistence.cpp, line 5271

Can Anyone Help me out where i I am doing wrong. wrong. Any Help is appreciated.

Thank you.