Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem in training HAAR classifier

When i try to start classifier training after about 1 minute i got this: " $ opencv_traincascaded.exe -data classifier -vec samples.vec -bg negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 600 -numNeg 900 -w 40 -h 90 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024 PARAMETERS: cascadeDirName: classifier vecFileName: samples.vec bgFileName: negatives.txt numPos: 600 numNeg: 900 numStages: 20 precalcValBufSize[Mb] : 1024 precalcIdxBufSize[Mb] : 1024 stageType: BOOST featureType: HAAR sampleWidth: 40 sampleHeight: 90 boostType: GAB minHitRate: 0.999 maxFalseAlarmRate: 0.5 weightTrimRate: 0.95 maxDepth: 1 maxWeakCount: 100 mode: ALL

===== TRAINING 0-stage ===== <begin pos="" count="" :="" consumed="" 600="" :="" 600="" neg="" count="" :="" acceptanceratio="" 900="" :="" 1="" precalculation="" time:="" 90.112="" +----+---------+---------+="" |="" n="" |="" hr="" |="" fa="" |="" +----+---------+---------+="" opencv="" error:="" assertion="" failed="" (dims="" &lt;="2" &amp;&amp;="" data="" &amp;&amp;="" (unsigned)i0="" &lt;="" (unsigned)si="" ze.p[0]="" &amp;&amp;="" (unsigned)(i1="" *="" datatype<_tp="">::channels) < (unsigned)(size.p[1] * cha nnels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file C:\OPENCV\opencv-maste r\modules\core\include\opencv2/core/mat.inl.hpp, line 845 "

Interesting thing is that if i use this option: -featureType LBP, then training works fine. I am trying to create classifier for detecting cars top view. This training i started just for example, and if it will begun to work i'l find more positive images to create good classifier. I used 73 positives and with help of createsemples.exe i created 600 samples (73 vec files) and merged them to create one samples.vec (4 Mb). All negative images i used are greyscale, i took them from base of negative images wich was used to create face recognizing classifier and sorted them out deleting any images with cars. P. S. Sorry for my bad english :)

Problem in training HAAR classifier

When i try to start classifier training after about 1 minute i got this: this:

" $ opencv_traincascaded.exe -data classifier -vec samples.vec -bg negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 600 -numNeg 900 -w 40 -h 90 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024 PARAMETERS: cascadeDirName: classifier vecFileName: samples.vec bgFileName: negatives.txt numPos: 600 numNeg: 900 numStages: 20 precalcValBufSize[Mb] : 1024 precalcIdxBufSize[Mb] : 1024 stageType: BOOST featureType: HAAR sampleWidth: 40 sampleHeight: 90 boostType: GAB minHitRate: 0.999 maxFalseAlarmRate: 0.5 weightTrimRate: 0.95 maxDepth: 1 maxWeakCount: 100 mode: ALL

===== TRAINING 0-stage ===== =====

<begin pos="" count="" :="" consumed="" 600="" :="" 600="" neg="" count="" :="" acceptanceratio="" 900="" :="" 1="" precalculation="" time:="" 90.112="" +----+---------+---------+="" |="" n="" |="" hr="" |="" fa="" |="" +----+---------+---------+="" opencv="" error:="" assertion="" failed="" (dims="" &lt;="2" &amp;&amp;="" data="" &amp;&amp;="" (unsigned)i0="" &lt;="" (unsigned)si="" ze.p[0]="" &amp;&amp;="" (unsigned)(i1="" *="" datatype<_tp="">::channels) +----+---------+---------+<="" p="">

OpenCV Error:

Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)size.p[0] && (unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * cha nnels()) channels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << ((1<< 3) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file C:\OPENCV\opencv-maste r\modules\core\include\opencv2/core/mat.inl.hpp, C:\OPENCV\opencv-master\modules\core\include\opencv2/core/mat.inl.hpp, line 845 "

Interesting thing is that if i use this option: -featureType LBP, then training works fine. I am trying to create classifier for detecting cars top view. This training i started just for example, and if it will begun to work i'l find more positive images to create good classifier. I used 73 positives and with help of createsemples.exe i created 600 samples (73 vec files) and merged them to create one samples.vec (4 Mb). All negative images i used are greyscale, i took them from base of negative images wich was used to create face recognizing classifier and sorted them out deleting any images with cars. cars.

P. S. Sorry for my bad english :)

Problem in training HAAR classifier

When i try to start classifier training after about 1 minute i got this:

" $

opencv_traincascaded.exe -data classifier -vec samples.vec -bg negatives.txt
negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 600 -numNeg 900
900 -w 40 -h 90 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024

This generates the following output

PARAMETERS:
cascadeDirName: classifier
vecFileName: samples.vec
bgFileName: negatives.txt
numPos: 600
numNeg: 900
numStages: 20
precalcValBufSize[Mb] : 1024
precalcIdxBufSize[Mb] : 1024
stageType: BOOST
featureType: HAAR
sampleWidth: 40
sampleHeight: 90
boostType: GAB
minHitRate: 0.999
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: ALL

ALL ===== TRAINING 0-stage =====

<begin pos="" count="" :="" consumed="" 600="" :="" 600="" neg="" count="" :="" acceptanceratio="" 900="" :="" 1="" precalculation="" time:="" 90.112="" +----+---------+---------+="" |="" n="" |="" hr="" |="" fa="" |="" +----+---------+---------+<="" p="">

===== <BEGIN POS count : consumed 600 : 600 NEG count : acceptanceRatio 900 : 1 Precalculation time: 90.112 +----+---------+---------+ | N | HR | FA | +----+---------+---------+ OpenCV Error:

Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)size.p[0] && (unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * channels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1<< 3) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file C:\OPENCV\opencv-master\modules\core\include\opencv2/core/mat.inl.hpp, line 845 "

845

Interesting thing is that if i I use this option:

-featureType LBP, LBP

then training works fine. I am trying to create a classifier for detecting cars top view. This training i I started just for example, and if it will begun to work i'l I will find more positive images to create good classifier. I used 73 positives and with help of createsemples.exe i createsamples.exe I created 600 samples (73 vec files) and merged them to create one samples.vec (4 Mb). All negative images i I used are greyscale, i I took them from base of negative images wich was used to create face recognizing classifier and sorted them out deleting any images with cars.

P. S. Sorry for my bad english :)