Ask Your Question

Revision history [back]

Assertion Failed during opencv_createsamples

I am trying to create a vec file from my positive image samples. I'm using the latest version of Opencv. The command I am using is this:

opencv_createsamples -info Positive.info -num 3750 -w 24 -h 24 -vec Positive.vec

All my images are bigger than 24x24, so I don't believe that that is the issue. I've tried searching online, but I don't find anyone with this error while doing the createsamples command. The output that I get when I run that is this:

Info file name: Positive.info
Img file name: (NULL)
Vec file name: Positive.vec
BG  file name: (NULL)
Num: 3750
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: 24
Height: 24
Max Scale: -1
RNG Seed: 12345
Create training samples from images collection...
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.0.0-alpha) 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 465

This is my first time using opencv, so I'm very unclear as to what this error is. Anyone have any experience with this or can point me in the right direction to correcting the error?

Assertion Failed during opencv_createsamples

I am trying to create a vec file from my positive image samples. I'm using the latest version of Opencv. The command I am using is this:

opencv_createsamples -info Positive.info -num 3750 -w 24 -h 24 -vec Positive.vec

All my images are bigger than 24x24, so I don't believe that that is the issue. I've tried searching online, but I don't find anyone with this error while doing the createsamples command. The output that I get when I run that is this:

Info file name: Positive.info
Img file name: (NULL)
Vec file name: Positive.vec
BG  file name: (NULL)
Num: 3750
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: 24
Height: 24
Max Scale: -1
RNG Seed: 12345
Create training samples from images collection...
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.0.0-alpha) 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 465

This is my first time using opencv, so I'm very unclear as to what this error is. Anyone have any experience with this or can point me in the right direction to correcting the error?

Edit: Here is the first few lines of my Positive.info file:

full_path\positives\7bc1acac12bbc9876db252efc0249c5863c9de9b620eb8745c5d1202.jpg 1 54 54 362 362 
full_path\positives\c1705114e4e13be2b0a8d4a214d59bbd7d8427cc7adadd3811712cd0.jpg 1 275 275 1835 1835
 full_path\positives\d103070d5cf33bd0b51f47dc2116ffdb764fba589b715858ca6415b6.png 1 36 36 351 351 
full_path\positives\8789913eb072be66371cedf7bf6ec1ce08780923e84847006730508e.jpg 1 42 42 282 282 
full_path\positives\b12785be8686004a39b9a32a2c0af56c75e650a8b93785979d797b2c.jpg 1 45 45 300 300 
full_path\positives\bef84d8d43a9fb5f119ca7e94863fd16a3e92206414e68bd18607b49.jpg 1 22 22 152 152 
full_path\positives\eef8e58c523263dc2371a899fa80686d50362e803e6c1d4b0c718cf1.jpg 1 41 41 275 275 
full_path\positives\df236ca99ff5e618a971bee4599e16672b5ded618c8b77a3b2a90216.jpg 1 75 75 501 501

The path to the files is correct.