Ask Your Question

Revision history [back]

Segmentation fault (core dumped) when using opencv_createsamples

Hello everyone! I am currently trying to make a HAAR classifier. I have made an annotation file and have done everything as described in the official openCV tutorial: . However, when I try to create the samples with opencv_createsamples, I get an error. My command:

opencv_createsamples -vec /some_dirs/samples/samples.vec -info /some_dirs/annotations/annotations.dat -w 8 -h 8 -num 100

The error:

Info file name: /home/nikifaets/code/pointsProcessing/annotations/annotations.dat Img file name: (NULL) Vec file name: /home/nikifaets/code/pointsProcessing/samples/samples.vec BG file name: (NULL) Num: 100 BG color: 0 BG threshold: 80 Invert: FALSE Max intensity deviation: 40 Max x angle: 1.1 Max y angle: 1.1 Max z angle: 0.5 Show samples: FALSE Width: 8 Height: 8 Max Scale: -1 RNG Seed: 12345 Create training samples from images collection... OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in resize, file /build/opencv/src/opencv-3.4.0/modules/imgproc/src/resize.cpp, line 4044 terminate called after throwing an instance of 'cv::Exception' what(): /build/opencv/src/opencv-3.4.0/modules/imgproc/src/resize.cpp:4044: error: (-215) ssize.width > 0 && ssize.height > 0 in function resize

Aborted (core dumped)

However, if I try to do only two samples (no idea why exactly 2...), it runs and creates the .vec file, although my dataset includes about 300-400 pictures.

Pastebin of annotations.dat

Thank you in advance for the support!