Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

[Java OpenCV] Fatal error in Imgproc.arcLength

I've been trying to recode the squares.cpp C++ example in Java, using OpenCV 2.4.6, and I'm stuck with an error I don't understand:

OpenCV Error: Assertion failed (curve.checkVector(2) >= 0 && (curve.depth() == CV_32F || curve.depth() == CV_32S)) in arcLength, file /local/XXXX/libs/opencv-2.4.6/modules/imgproc/src/contours.cpp, line 1886

But when I check my curve, I get:

  • curve.checkVector(2) = 4

  • curve toString output: Mat [ 41CV_32SC2, isCont=true, isSubmat=false, nativeObj=0x7ffca453be90, dataAddr=0x7ffca4588720 ]

So I should be able to pass the assertion, but I fail.

Is CV_32SC2 different from CV_32S?

[Java OpenCV] Fatal error in Imgproc.arcLength

I've been trying to recode the squares.cpp C++ example in Java, using OpenCV 2.4.6, and I'm stuck with an error I don't understand:

OpenCV Error: Assertion failed (curve.checkVector(2) >= 0 && (curve.depth() == CV_32F || curve.depth() == CV_32S)) in arcLength, file /local/XXXX/libs/opencv-2.4.6/modules/imgproc/src/contours.cpp, line 1886

But when I check my curve, I get:

  • curve.checkVector(2) = 4

  • curve toString output: Mat [ 414 * 1 * CV_32SC2, isCont=true, isSubmat=false, nativeObj=0x7ffca453be90, dataAddr=0x7ffca4588720 ]

So I should be able to pass the assertion, but I fail.

Is CV_32SC2 different from CV_32S?