apriltag.corners() to subpixel precision ?

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

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/master/src/omv/img/apriltag.c#L11724

The values are stored in this struct:

https://github.com/openmv/openmv/blob/master/src/omv/img/imlib.h#L1095

And the access methods for python are here:

https://github.com/openmv/openmv/blob/master/src/omv/py/py_image.c#L4378

And the python keywords are here:

https://github.com/openmv/openmv/blob/master/src/omv/py/qstrdefsomv.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.

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

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