opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.33k stars 5.75k forks source link

Aruco: AprilTag corner refinement leads to "Integer division by zero" exception #2643

Closed jokokojote closed 3 years ago

jokokojote commented 4 years ago
System information (version)
Detailed description

When using AprilTag as corner refinement method for Aruco marker detection, an "Integer division by zero" exception occurs when detectMarkers() is called. This is the case for 4.3.0 and 4.4.0 versions. All other corner refinement methods work.

I know UWP is not supported officially, but nevertheless a lot of people use Aruco on Hololens etc., so I post this here for sake of completeness. Apart from this I guess this is not an UWP specific problem, but I did no tests on other platforms.

Steps to reproduce
    cv::Ptr<cv::aruco::Dictionary> dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_4X4_1000);
    cv::Ptr<cv::aruco::DetectorParameters> detectorParams = cv::aruco::DetectorParameters::create();
    detectorParams->cornerRefinementMethod = cv::aruco::CORNER_REFINE_APRILTAG;
        ...
    cv::aruco::detectMarkers(cameraFrame, dictionary, corners, ids, detectorParams);
catree commented 4 years ago

You should build in debug mode and post the strack trace.