Camera Calibration with AprilTags not working with png image datafile

조회 수: 5 (최근 30일)
Andrew Roley
Andrew Roley 2021년 1월 8일
답변: Vinoth Venkatesan 2021년 2월 5일
I'm trying to follow this example.
In both MATLAB online and 2020b, I get the following error when trying to detect tags in my calibration images:
Matrix index is out of range for deletion.
Error in CalibrateCameraUsingAprilTagBasedPatternExample>helperDetectAprilTagCorners (line 161)
imagePoints(:,:,idx) = [];
I have passed imdsCalib my filetype as described here.
I want to use pngs for calibration because I want the most accurate calibration possible, and intend to use pngs for detection, again for the most accurate detections possible. Is there something I'm doing wrong? Or is this not possible at all?
Thank you for any and all help!
  댓글 수: 1
Andrew Roley
Andrew Roley 2021년 1월 12일
So I ended up adding a few statements to diagnose what was happening right before the problematic line 161, and this was helpful:
numel(tagIds)
It prints the number of tags identified in the particular image that is being parsed through. I seemed to get this problem only after multiple poor detections with less than the expected number of tags, and it seemed to happen on the second to last image, which was very odd.
I then went through and individually deleted those files without the full tags detected, and it worked from there. I wouldn't call this a "solution", moreso a workaround, so I'm leaving the question unanswered until someone with better knowledge than I can comment.

댓글을 달려면 로그인하십시오.

답변 (2개)

Amrtanshu Raj
Amrtanshu Raj 2021년 2월 5일
Hi,
I have brought this issue to the notice of our developers. They will investigate the matter further.

Vinoth Venkatesan
Vinoth Venkatesan 2021년 2월 5일
Hi Andrew,
This is a bug in a helper function that is part of the example. Please replace the helperDetectAprilTagCorners function at the end of the example file (CalibrateCameraUsingAprilTagBasedPatternExample.mlx) with the function attached here to resolve the issue.
Thanks, Vinoth

카테고리

Help CenterFile Exchange에서 Camera Calibration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by