Ask Your Question
0

cascade classifier training error

asked 2013-05-12 20:37:31 -0600

JAChen gravatar image

updated 2013-05-12 20:41:46 -0600

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.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-05-15 19:16:46 -0600

eanes gravatar image

Are your neg images in gray level mode?

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

edit flag offensive delete link more

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 ( 2013-05-22 06:50:59 -0600 )edit

Question Tools

Stats

Asked: 2013-05-12 20:37:31 -0600

Seen: 937 times

Last updated: May 15 '13