Why aruco doesn't detect markers in my image

Viewed 1572

I generate a series of aruco markers DICT_4X4_50 and I print them but when I launch the detector on this image for example, it doesn't work.. Though the marker is fairly visible:

enter image description here

int main(int argv, char** argc)
{
    Mat frame = imread(argc[1], CV_LOAD_IMAGE_COLOR);

    vector<int> markerIds;
    vector<vector<Point2f>> markerCorners, rejectedCandidates;

    Ptr<aruco::Dictionary> markerDictionary = aruco::getPredefinedDictionary(aruco::PREDEFINED_DICTIONARY_NAME::DICT_4X4_50);

    aruco::detectMarkers(frame, markerDictionary, markerCorners, markerIds);


    aruco::drawDetectedMarkers(frame, markerCorners, markerIds);
    imshow("Webcam", frame);
    waitKey(0);

}

Is the image not good enough or is there some parameters I can modify?

1 Answers
Related