opencv / opencv_contrib

Repository for OpenCV's extra modules
Apache License 2.0
9.42k stars 5.76k forks source link

ArUco tutorial should contain camera parameters of example images #3045

Closed friederwC closed 2 years ago

friederwC commented 3 years ago
System information (version)
Detailed description

The tutorial comes with great code examples and the marker detection example can easily be tested with the image provided by the tutorial: https://docs.opencv.org/4.5.3/singlemarkersoriginal.jpg However, for the pose estimation example, the camera parameters are required. Here it would be great if they were provided for the example image. The tutorial assumes, that one takes and uses their own image and calibrates their camera, but it would be nice if it was possible to follow the tutorial without taking pictures.

Steps to reproduce

Go to https://docs.opencv.org/4.5.3/d5/dae/tutorial_aruco_detection.html

AleksandrPanov commented 2 years ago

These camera parameters (from test_arucodetection.cpp) can be used:

    Size imgSize = inputImage.size();

    Mat cameraMatrix = Mat::eye(3, 3, CV_64FC1);
    cameraMatrix.at< double >(0, 0) = cameraMatrix.at< double >(1, 1) = 650;
    cameraMatrix.at< double >(0, 2) = imgSize.width / 2;
    cameraMatrix.at< double >(1, 2) = imgSize.height / 2;
    Mat distCoeffs(5, 1, CV_64FC1, Scalar::all(0));

image

repr_acuco.cpp.txt

It remains to add the code to the tutorial and open PR.