Ask Your Question

Revision history [back]

Create_samples ending with Segmentation Fault

Hi!

I'm following this tutorial https://pythonprogramming.net/haar-cascade-object-detection-python-opencv-tutorial/ with the goal to build a crocodilo detector. When it comes to create the sample with:

opencv_createsamples -img 1.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1950

I'm having the famous segmentation fault:

Create test samples from single image applying distortions...
Segmentation fault (core dumped)

This is my full output in the terminal:

Info file name: info/info.lst
Img file name: 1.jpg
Vec file name: (NULL)
BG  file name: bg.txt
Num: 1950
BG color: 0
BG threshold: 80
Invert: FALSE
Max intensity deviation: 40
Max x angle: 0.5
Max y angle: 0.5
Max z angle: 0.5
Show samples: FALSE
Width: 24
Height: 24
Max Scale: -1
Create test samples from single image applying distortions...
Segmentation fault (core dumped)

I already tried to update my create_sample folder with https://github.com/opencv/opencv/tree/master/apps/createsamples but still having the segmentation fault.

My workspace:

opencv_workspace
|_ info(folder)
|_data(folder)
|_ neg(folder)
   |_ images.jpg
|_opencv(folder)
|_1.jpg
|_bg.txt

Hope I could make it clear! Thanks :D