Effacer les filtres
Effacer les filtres

Issue with estimate pose of an AprilTag in Simulink

7 vues (au cours des 30 derniers jours)
Alberto Rimoli
Alberto Rimoli le 10 Juin 2022
Hi, I'm experiencig this problem in a simulink project using this function:
[id, loc, pose]=readAprilTag(image,tagFamily,myobj,tagSize);
%% the image comes from the simulation 3D camera block; TagFamily = 'tag36h11' ; myobj=cameraParameters('ImageSize',[y_f_plane,x_f_plane], 'IntrinsicMatrix',Intr_Matrix); tagSize=800 mm (WorldUnits in cameraParameters is set to millimeters)%%
I can read the AprilTag (the id number) and the position of its four corners in the image, but if I want also the information about the pose with respect to the camera, I get the eye Matrices for pose.T (4x4) and pose.Rotation(3x3) and a zeros vector for pose.Translation (1X3).
There is someone with some interesting suggestions? I really appreciate it.
Thank You,
Alberto

Réponses (1)

Maneet Kaur Bagga
Maneet Kaur Bagga le 23 Fév 2024
Hi,
As per my understanding from the code given, it is supposed to read an "AprilTag" from an image captured by a simulation of 3D Camera block and the code is intended to return three outputs which are the identifier, the location of the tag's four corner in the image and the pose of the tag with respect to the camera, which includes the rotation and translation information. As mentioned you are able to detect the "AprilTag" and its location but the pose information from the readAprilTag function is not correct. The possible workaround for the error is as follows:
From the documentation of the "readAprilTag" function it requires four parameters as input which are the input image "I", "tagFamily" which will detect the AprilTags of only the specified families, "intrinsics" and tagSize" which returns the poses of the tags with respect to the specified camera intrinsic properties and the size of the tags.
[id,loc,pose] = readAprilTag(T,tagFamily,intrinsics,tagSize)
From the code given it seems you have used the "cameraParameters" function as input to the third argument i.e the intrinsics in the function, although refering from the documentation of the "cameraParameters" function it states that the function stores the intrinsic, extrinsic and lens distortion parameters of a camera, therefore it might not give accurate result as expected.
So you may use the "cameraIntrinsics" object which contains information about the camera intrinsic calibration parameters, which is required in the third argument of the "readAprilTag" function.
Please refer to the MathWorks Documentation for further understanding:
Hope this helps!

Community Treasure Hunt

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

Start Hunting!

Translated by