Ask Your Question
0

Create_samples ending with Segmentation Fault

asked 2018-08-19 12:38:13 -0600

Hi!

I'm following this tutorial https://pythonprogramming.net/haar-ca... 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... 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

edit retag flag offensive close merge delete

Comments

1

yea, there is this bug, but you can't successfully train cascades with a single image anyway.

get a TON of real positive images, and try again.

berak gravatar imageberak ( 2018-08-20 00:42:30 -0600 )edit

and take that silly tutorial with a grain of salt -- in the end he can't detect his watch.

berak gravatar imageberak ( 2018-08-20 00:48:10 -0600 )edit

also, artificial distortions, a no-go for anything useful :D

StevenPuttemans gravatar imageStevenPuttemans ( 2018-08-20 08:58:02 -0600 )edit

Oh boy, so the tutorial will not work? :/ Do you guys have some tips so I can achieve my goal?

sgpedro gravatar imagesgpedro ( 2018-08-20 09:43:39 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-08-21 02:52:28 -0600

At least start by following the official tutorial, which can be seen here and which already discusses everything in quite the detail. I can also recommend chapter 5 of OpenCV3Blueprints, which goes over the process in much detail step by step.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-08-19 12:38:13 -0600

Seen: 416 times

Last updated: Aug 19 '18