PhotonVision / photonvision

PhotonVision is the free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition.
https://photonvision.org
GNU General Public License v3.0
264 stars 179 forks source link

Where did max error bits > 7 recommendation come from? #1369

Open sciencewhiz opened 7 months ago

sciencewhiz commented 7 months ago

The docs recommend max error bits > 7 for tag family 36h11. However, the official AprilTag library does not support values >3. https://github.com/AprilRobotics/apriltag/blob/4a689cc13cfe1f3b31f7ea6f07575364e65b2c90/apriltag.c#L261-L267

Where did this recommendation come from?

https://docs.photonvision.org/en/latest/docs/apriltag-pipelines/2D-tracking-tuning.html#max-error-bits

sciencewhiz commented 7 months ago

Additionally, was memory taken into account with this recommendation? This implies that memory usage grows very quickly with more error bits corrected.

https://github.com/AprilRobotics/apriltag_ros/issues/73

The memory consumption is essentially O(n choose k) == O(n!/(k! * (n-k)!)) where n is the number of tags in the family and k is whatever you set the number of bits to (as long as k << n).

A practical example, although with a bigger n here: https://github.com/AprilRobotics/apriltag_ros/pull/93#issuecomment-815144047

mdurrani808 commented 7 months ago

It was just from testing if i remember correctly. This is the only message that I can find to back it up https://discord.com/channels/725836368059826228/725848198794706994/1040671053451644978.

If you could submit an issue over to the main repo to cap things at 3 and we'll change this recommendation.