Camera Calibration with AprilTags not working with png image datafile

1 次查看(过去 30 天)
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
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 中查找有关 MATLAB Support Package for USB Webcams 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by