Ask Your Question
0

how can I solve this error?

asked 2018-07-06 12:23:42 -0600

delpozo95 gravatar image

updated 2018-07-07 03:54:59 -0600

berak gravatar image

I´m triying to create a vector using this opencv_createsamples -info info/info.lst -num 1330 -w 20 -h 20 -vec positives.vec in cmd.

I have 1350 pictures in info and info.lst has this structure: picturename.jpg objects x1 y1 x2 y2 (x and y are the first and the last point of the rectangle label).

But I get this problem: OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in cv::Mat::Mat, file C:\build\master_winpack-build-win64-vc15\opencv\modules\core\src\matrix.cpp, line 538

Y use -show and i think that the problem is that mi pictures has 600x480 pixels and when any label has any point of the rectangle higher than 350, i get the same problem mensaje.

Anyone know any solution in order to keep my labels?

Sorry for my english. Thanks for your time.

edit retag flag offensive close merge delete

Comments

1

In my opinion, it is far easier to train a neural network (for example mobilenet ssd using for instance TensorFlow) to perform object detection than try to train a cascade of classifiers. The model can then be loaded with OpenCV.

Eduardo gravatar imageEduardo ( 2018-07-07 06:22:03 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2018-07-07 03:48:56 -0600

berak gravatar image

please have another look at the tutorial

most likely, your txt file has the wrong structure. try with lines like:

/complete/path/to/img  numrects x y w h  x y w h ...

(you need to specify, how many rects there are, and those are x y w h, NOT x1 y1 x2 y2)

edit flag offensive delete link more

Comments

Yes, this is my problem. Thanks.

delpozo95 gravatar imagedelpozo95 ( 2018-07-08 10:58:06 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-07-06 12:23:42 -0600

Seen: 191 times

Last updated: Jul 07 '18