Page 1 of 1

apriltag.corners() to subpixel precision ?

Posted: Sat Dec 08, 2018 7:28 am
by ecdm2
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

Re: apriltag.corners() to subpixel precision ?

Posted: Sat Dec 08, 2018 11:09 pm
by kwagyeman
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.

Re: apriltag.corners() to subpixel precision ?

Posted: Sun Dec 09, 2018 5:07 am
by ecdm2
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

Re: apriltag.corners() to subpixel precision ?

Posted: Sun Dec 09, 2018 12:33 pm
by kwagyeman
Okay. This will amke it in eventually. I'll have a lot of time to work soon.