Ask Your Question

Revision history [back]

Error at the begining of Training Stage 1

Hi guys, i am totally new in our OpenCv community, i am from France so excuse my english if its start to turn crazy ahaha.

I started this week end to build a Haar cascade, i work on a window 10, my serv is a Debian machine (4G Ram, slow machine). i downloaded 1920 images in my neg file, i did the bg.txt (here "bgdef.txt") i created samples with my Pos image (1920 too) (only one pos image that i copied into Neg images with :

opencv_createsamples -img voiture5050.jpg -bg bgdef.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle -0.5 -maxzangle 0.5 -num 1920

also my positives.vec with :

opencv_createsamples -info info/info.lst -num 1920 -w 20 -h 20 -vec positives.vec

opencv_traincascade -data data -vec positives.vec -bg bgdef.txt -numPos 1920 -numNeg 1900 -numStages 10 -w 20 -h 20

when i start my training with : opencv_traincascade -data data -vec positives.vec -bg bgdef.txt -numPos 1920 -numNeg 1900 -numStages 10 -w 20 -h 20 then its start training... Stage 0 complete in 37 min... then Bam Stage 1 it's stop with the message :

===== TRAINING 1-stage ===== BEGIN POS current samplOpenCV Error: Bad argument (Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file. ) in get, file /build/opencv-FWWjHr/opencv-2.4.9.1+dfsg/apps/traincascade/imagestorage.cpp, line 162 terminate called after throwing an instance of 'cv::Exception' what(): /build/opencv-FWWjHr/opencv-2.4.9.1+dfsg/apps/traincascade/imagestorage.cpp:162: error: (-5) Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file. in function get

Abandonrent samples: 1911

i did the same thing as Sentex on Youtube : https://www.youtube.com/watch?v=eay7CgPlCyo&t=3s

i am here to learn so tell me what's wrong, i already love that kind of work :) And a serious BRAVO to OpenCv

sebastien