First time here? Check out the FAQ!

Ask Your Question
0

cascade classifier training error

asked May 13 '13

JAChen gravatar image

updated May 13 '13

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

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() + 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.

Preview: (hide)

1 answer

Sort by » oldest newest most voted
1

answered May 16 '13

eanes gravatar image

Are your neg images in gray level mode?

This error may be related to number of channels of the images.

Preview: (hide)

Comments

My input image format was bmp file. And I also used gray level images, it did not work.

================= Error message =============== Train dataset for temp stage can not be filled. Branch training terminated. Cascade classifier can't be trained. Check the used training parameters.

JAChen gravatar imageJAChen (May 22 '13)edit

Question Tools

Stats

Asked: May 13 '13

Seen: 957 times

Last updated: May 15 '13