First time here? Check out the FAQ!

Ask Your Question
1

OpenCV Error: Assertion failed (s >= 0) in setSize

asked Jun 27 '13

Ferran Roure gravatar image

Hi everyone,

I'm new user and I'm trying to execute my program that uses opencv. It compiles but during the exeution it appears this error.

OpenCV Error: Assertion failed (s >= 0) in setSize, file /<path_to_opencv>/OpenCV/OpenCV-2.4.3/modules/core/src/matrix.cpp, line 115 terminate called after throwing an instance of 'cv::Exception' what(): /<path_to_opencv>/OpenCV/OpenCV-2.4.3/modules/core/src/matrix.cpp:115: error: (-215) s >= 0 in function setSize

Can you help me? I've search through the internet for solutions but I didn't find anything related.

Thanks!!

Ferran.-

Preview: (hide)

1 answer

Sort by » oldest newest most voted
4

answered Jun 27 '13

Siegfried gravatar image

Hi,

when you create your cv::mat one of the size values (row or column) is lower than 0. You can't create a matrix with a negative number of rows or columns.

In future questions you should provide the code which produce the error.

Preview: (hide)

Comments

Thank! I've found the error. Is the problem of working with a code that is not mine. :P

Thank you very much! :D


ferran

Ferran Roure gravatar imageFerran Roure (Jun 27 '13)edit

hi, can you answer my error too ? http://answers.opencv.org/question/93...

dott gravatar imagedott (Apr 20 '16)edit

Question Tools

Stats

Asked: Jun 27 '13

Seen: 30,460 times

Last updated: Jun 27 '13