Skip to content

Fix aruco tutorials #3396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Dec 23, 2022
Merged

Fix aruco tutorials #3396

merged 15 commits into from
Dec 23, 2022

Conversation

stopmosk
Copy link
Contributor

@stopmosk stopmosk commented Dec 20, 2022

Fix code snippets and some text in Aruco tutorial.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@stopmosk stopmosk requested a review from asmorkalov December 20, 2022 08:24
@asmorkalov
Copy link
Contributor

Please replace original paper reference with doxygen site:

> S. Garrido-Jurado, R. Muñoz-Salinas, F. J. Madrid-Cuevas, and M. J. Marín-Jiménez. 2014.
> "Automatic generation and detection of highly reliable fiducial markers under occlusion".
> Pattern Recogn. 47, 6 (June 2014), 2280-2292. DOI=10.1016/j.patcog.2014.01.005

Like here: https://github.com/opencv/opencv/blob/4.x/modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp#L29

if accurate corners are not necessary. Possible values are `CORNER_REFINE_NONE`, `CORNER_REFINE_SUBPIX`, `CORNER_REFINE_CONTOUR`, and `CORNER_REFINE_APRILTAG`.
This parameter determines whether the corner subpixel process is performed or not and which method to use
if it is being performed. It can be disabled if accurate corners are not necessary. Possible values are
`CORNER_REFINE_NONE`, `CORNER_REFINE_SUBPIX`, `CORNER_REFINE_CONTOUR`, and `CORNER_REFINE_APRILTAG`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use # before enum keys. Doxygen adds links to known ids.

@asmorkalov asmorkalov added category: documentation Documentation fix or update, does not affect code category: samples labels Dec 22, 2022
@@ -160,19 +167,10 @@ int main(int argc, char *argv[]) {
// detect markers and estimate pose
detector.detectMarkers(image, corners, ids, rejected);

int nMarkers = corners.size();
int nMarkers = (int)corners.size();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's more efficient to define size_t nMarkers. And use size_t i.

cv::Vec3d rvec, tvec;

// If at least one marker detected
if(markerIds.size() > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(!markerIds.empty())

@stopmosk stopmosk force-pushed the fix-aruco-tutorials branch from 1b43214 to 22d0e71 Compare December 22, 2022 13:45
@asmorkalov asmorkalov self-assigned this Dec 23, 2022
@asmorkalov asmorkalov merged commit 0c6b04a into opencv:4.x Dec 23, 2022
@alalek alalek mentioned this pull request Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: documentation Documentation fix or update, does not affect code category: samples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants