Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

No error line number in OpenCV?

I am a starter for OpenCV. I installed my OpenCV on mac and it succeed. However, whenever I run the program and the program failed, it cannot give which line I am wrong but only output wrong information in OpenCV. For example, I wrote a long program and when running it, it gives the following result but I don't know which line it is(suppose my file is main.cpp)

OpenCV Error: Assertion failed (s >= 0) in setSize, 
file /Users/home/Documents/tools/opencv-2.4.9/modules/core/src/matrix.cpp, line 116
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: 
/Users/home/Documents/tools/opencv-2.4.9/modules/core/src/matrix.cpp:116: error: (-215) s >= 0 in    
function setSize

so I really don't know where is the problem. I compiled my files using following commands:

g++ -Wall -std=c++11 -I/usr/local/include/opencv -lm -lopencv_core -lopencv_highgui -lopencv_imgproc -o main main.cpp