Failed assertion in aruco detectMarkers()

asked 2018-03-08 08:05:07 -0600

michal gravatar image

Hi,

I'm getting a following run-time error when using ArUco's aruco::detectMarkers():

OpenCV(3.4.1-dev) Error: Assertion failed (mtype == type0 || (((((mtype) & ((512 - 1) << 3)) >> 3) + 1) == ((((type0) & ((512 - 1) << 3)) >> 3) + 1) && ((1 << type0) & fixedDepthMask) != 0)) in create, file 
/home/upboard/opencv/modules/core/src/matrix_wrap.cpp, line 1399
terminate called after throwing an instance of 'cv::Exception'
what():  OpenCV(3.4.1-dev) /home/upboard/opencv/modules/core/src/matrix_wrap.cpp:1399: error: (-215) mtype == type0 || (((((mtype) & ((512 - 1) << 3)) >> 3) + 1) == ((((type0) & ((512 - 1) << 3)) >> 3) + 1) && ((1 << type0) & fixedDepthMask) != 0) in function create

This error tells me absolutely nothing... I run the program in gdb and the backtrace goes as follows (it's simplified and without arguments):

cv::aruco::detectMarkers()
cv::aruco::_copyVector2Output()
cv::_OutputArray::create()
cv::_OutputArray::create()
cv::error()

If you need anything more to be able to tell me what's wrong I will get you the data of course.

Here is the full source code : https://pastebin.com/P1zhWFir

Thank you

edit retag flag offensive close merge delete

Comments

i have never tried, but maybe vector<vector<Point_<float>>> marker_corners; should be a std::vector<std::vector<cv::Point2f>> markerCorners ? see tutorial

berak gravatar imageberak ( 2018-03-08 09:26:44 -0600 )edit

So:

Point2f

Is just a typedef for

Point_<float>

And changing the name of variable isn't something that can help.

michal gravatar imagemichal ( 2018-03-09 01:44:11 -0600 )edit

no, meant double vector (in the sample) vs triple vector (yours)

berak gravatar imageberak ( 2018-03-09 05:38:13 -0600 )edit