apriltag.corners() to subpixel precision ?

Discussion related to "under the hood" OpenMV topics.
ecdm2
Posts: 3
Joined: Sun Sep 09, 2018 6:15 am

apriltag.corners() to subpixel precision ?

Postby ecdm2 » Sat Dec 08, 2018 7:28 am

Hello

In Olson's 2011 AprilTag paper he states that the:

" ... corner estimates are accurate to a small fraction of a pixel."

I've been using the apriltag.corners() to get the corner positions of the tags but they are only returned with pixel (integer) precision.

Could you change this in the C/C++ firmware so that the corner positions are returned as floating point - tenths or hundredths of a pixel precision ?

I would like to use the OpenMV cam and AprilTags to measure camera position.

I was hoping to take the corner positions from OpenMV into OpenCV and, together with the 'known' corner positions for a printed array of tags, use them with solvePnP to calibrate the output from apriltag.x_ , y_ and z_translation.

Please note that this is not the same as camera calibration for fx, fy, cx and cy - I've done that separately.

Best Wishes,

Ed
User avatar
kwagyeman
Posts: 2467
Joined: Sun May 24, 2015 2:10 pm

Re: apriltag.corners() to subpixel precision ?

Postby kwagyeman » Sat Dec 08, 2018 11:09 pm

Yes, we can enable this. However, if you can do a PR it will get in faster:

The corners are stored here:

https://github.com/openmv/openmv/blob/m ... g.c#L11724

The values are stored in this struct:

https://github.com/openmv/openmv/blob/m ... ib.h#L1095

And the access methods for python are here:

https://github.com/openmv/openmv/blob/m ... ge.c#L4378

And the python keywords are here:

https://github.com/openmv/openmv/blob/m ... omv.h#L880

It's straight forward to edit the code to add in what you need. If you can't make a PR for this then create a bug tracker on github for the feature.
Nyamekye,
ecdm2
Posts: 3
Joined: Sun Sep 09, 2018 6:15 am

Re: apriltag.corners() to subpixel precision ?

Postby ecdm2 » Sun Dec 09, 2018 5:07 am

Thank You Kwabena

I'm not that familiar with C / Cython and I'm really pressed with project demands at the moment. Ironically this looks looks like a good place to start getting familiar with the firmware.

I've submitted as an issue on GitHub for now anyway. Hope that is OK.

Best,

Ed
User avatar
kwagyeman
Posts: 2467
Joined: Sun May 24, 2015 2:10 pm

Re: apriltag.corners() to subpixel precision ?

Postby kwagyeman » Sun Dec 09, 2018 12:33 pm

Okay. This will amke it in eventually. I'll have a lot of time to work soon.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests