Skip to content
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

How to compute distance of tag from camera ? #8

Open
pra-dan opened this issue Sep 22, 2020 · 5 comments
Open

How to compute distance of tag from camera ? #8

pra-dan opened this issue Sep 22, 2020 · 5 comments

Comments

@pra-dan
Copy link

pra-dan commented Sep 22, 2020

Hi, Thanks for this amazing resource !

I am able to get results (using test images and test YAML) nicely. The coordinates of the detected tags are obtained as shown in the pic.

Screenshot from 2020-09-22 10-43-42

I am unable to understand what do the parameters mean:

param description
pose_R* Rotation matrix of the pose estimate.
pose_t* Translation of the pose estimate.
pose_err* Object-space error of the estimation.

Also, how should I compute the distance of the tag from the camera ?

@pra-dan
Copy link
Author

pra-dan commented Sep 22, 2020

Ok, I get what rotation and translation matrix mean. Thanks to this StackOverflow answer and this paper.

I suppose, if in the camera projective, we define the center of the marker as (XW,YW,ZW) in the marker/tag coordinate system and (XC,YC,ZC) in the camera coordinate,
Screenshot from 2020-09-22 11-24-15

then,

d = ((XC - 0)2 + (YC - 0)2 + (ZC - 0)2)1/2

should correspond to the distance of the tag from the camera. Right ?

@pra-dan
Copy link
Author

pra-dan commented Sep 22, 2020

Hey @fnoop Thanks for confirming. Another thing is, the program returns the coordinates of the center of the detected tag as center = [399.22982016 718.50388705] i.e., only XW and YW. How to assume/find the ZW and hence compute the corresponding (XC,YC,ZC) ?

@fnoop
Copy link

fnoop commented Sep 23, 2020

Sorry I haven't used apriltags yet, I just happened to come across your issue while evaluating it!

@DanielChaseButterfield
Copy link
Contributor

@pra-dan The center attribute is a reference to the center of the tag in the image, not in 3D space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants