opencv_traincascade keeps core dumping [closed]

asked 2020-07-27 18:08:39 -0600

I'm trying to create custom cascades and I'm able to generate my .vec with opencv_createsample and I previewed it and it is for sure correct.

But when I do opencv_traincascade it starts the first iteration and core dumps.

This is exactly what it says:

===== TRAINING 0-stage ===== BEGIN OpenCV Error: Assertion failed (_img.rows * _img.cols == vecSize) in get, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/apps/traincascade/imagestorage.cpp, line 153 terminate called after throwing an instance of 'cv::Exception' what(): /build/opencv-L2vuMj/opencv-3.2.0+dfsg/apps/traincascade/imagestorage.cpp:153: error: (-215) _img.rows * _img.cols == vecSize in function get

Aborted (core dumped)

I saw that it could be because my positives and negatives are different sizes so I made sure they're both 25x25 and it still core dumps.

Here is exactly what i'm entering into the terminal: opencv_traincascade -data ./ -vec ./hand.vec -bg ./bg.dat -numPos 1000 -numNeg 500 -numStages 2 -w 25 h 25

Any help is greatly appreciated!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2020-07-29 01:57:49.808794

Comments

please don't resize the negatives, else it can't crop out multiple patches from there

-h 25 (hyphen missing)

berak gravatar imageberak ( 2020-07-28 02:46:59 -0600 )edit

Wow. I can't believe I was so blind. Thank you so much berak!

mdaccrim97 gravatar imagemdaccrim97 ( 2020-07-28 08:50:02 -0600 )edit