OpenCV C++ detect_diamonds.cpp crashes during execution

48 Views Asked by At

I am trying to use the detect_diamonds.cpp example from OpenCV C++, but when I run the program, it crashes at the aruco::detectCharucoDiamond function and displays the following error message:

before board.matchImagePoints(markerCorners, markerIds, objPoints, imgPoints);
after board.matchImagePoints(markerCorners, markerIds, objPoints, imgPoints);
after solvePnP
after projectPoints
before selectAndRefineChessboardCorners
OpenCV(4.7.0-dev) Error: Assertion failed (0 \<= i && i \< (int)vv.size()) in cv::debug_build_guard::InputArray::getMat, file C:\\Program Files\\opencv\\sources\\modules\\core\\src\\matrix_wrap.cpp, line 72

I am using Windows 10, Visual Studio 2019 as my compiler, and OpenCV version 4.7.0. I have successfully run other examples of AruCo.

I used the CharucoDiamond image(10cm*10cm) below, which was generated using the create_diamond.cpp examples (parameters:-sl=300 -ml=200 -d=8 -ids=0,1,2,3 -m=50 -bb=1):

CharucoDiamond Marker Image

The parameters used in detect_diamonds.cpp example are:

-sl=0.03 -ml=0.02 -d=8 -ci=0.c=CalibrationChArUcoBoard.yml -dp=detector_params.yml -rs -refine=1

I would greatly appreciate any help that anyone can provide. Thank you!

0

There are 0 best solutions below