Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cascade classifier training error

Hi everyone,

I want to use the cascade classifier training of OpenCV 2.4.5.0.

I have done step by step as http://docs.opencv.org/doc/user_guide/ug_traincascade.html

but have error message as following

=============================================== PARAMETERS: cascadeDirName: Data\cascade\ vecFileName: Pos\pos.vec bgFileName: Neg\neg.txt numPos: 300 numNeg: 900 numStages: 10 precalcValBufSize[Mb] : 256 precalcIdxBufSize[Mb] : 256 stageType: BOOST featureType: HAAR sampleWidth: 20 sampleHeight: 20 boostType: GAB minHitRate: 0.995 maxFalseAlarmRate: 0.5 weightTrimRate: 0.95 maxDepth: 1 maxWeakCount: 100 mode: BASIC

===== TRAINING 0-stage ===== <begin pos="" count="" :="" consumed="" 300="" :="" 300="" neg="" count="" :="" acceptanceratio="" 900="" :="" 1="" precalculation="" time:="" 23.314="" +----+---------+---------+="" |="" 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 unknown function, file D:\OpenCV\opencv_

src\modules\core\include\opencv2/core/mat.inl.hpp, line 722

I traced this error in source code.

The error might be due to wrong pointer assignment

boost.cpp line 726

================================================================

const unsigned short* shortIndices = (const unsigned short)(buf->data.s + n->buf_idxget_length_subbuf() + vi*sample_count + n->offset );

I do not know how to fix this error.

Did I make any mistakes such as wrong input setting?

Could anybody help me, please.

cascade classifier training error

Hi everyone,

I want to use the cascade classifier training of OpenCV 2.4.5.0.

I have done step by step as http://docs.opencv.org/doc/user_guide/ug_traincascade.html

but have error message as following

=============================================== PARAMETERS:


PARAMETERS:

cascadeDirName: Data\cascade\ Data\cascade\

vecFileName: Pos\pos.vec Pos\pos.vec

bgFileName: Neg\neg.txt Neg\neg.txt

numPos: 300 300

numNeg: 900 900

numStages: 10 10

precalcValBufSize[Mb] : 256 256

precalcIdxBufSize[Mb] : 256 256

stageType: BOOST BOOST

featureType: HAAR HAAR

sampleWidth: 20 20

sampleHeight: 20 20

boostType: GAB GAB

minHitRate: 0.995 0.995

maxFalseAlarmRate: 0.5 0.5

weightTrimRate: 0.95 0.95

maxDepth: 1 1

maxWeakCount: 100 100

mode: BASIC

===== TRAINING 0-stage ===== <begin pos="" count="" :="" consumed="" 300="" :="" 300="" neg="" count="" :="" acceptanceratio="" 900="" :="" 1="" precalculation="" time:="" 23.314="" +----+---------+---------+="" |="" 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) =====

<begin< p="">

POS count : consumed 300 : 300

NEG count : acceptanceRatio 900 : 1

Precalculation time: 23.314

+----+---------+---------+

| N | HR | FA |

+----+---------+---------+

OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)si

ze.p[0] && (unsigned)(i1 * DataType<_Tp>::channels) < (unsigned)(size.p[1] * cha cha

nnels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 ((1

<< 3) - 1))*4) & 15) == elemSize1()) in unknown function, file D:\OpenCV\opencv_

src\modules\core\include\opencv2/core/mat.inl.hpp, line 722


I traced this error in source code.

The error might be due to wrong pointer assignment

boost.cpp line 726

================================================================


const unsigned short* shortIndices = (const unsigned shortshort*)(buf->data.s +

n->buf_idx)(buf->data.s + n->buf_idxget_length_subbuf() + vi*sample_count visample_count + n->offset );


I do not know how to fix this error.

Did I make any mistakes such as wrong input setting?

Could anybody help me, please.