Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default AprilTagDetector has very limited tag detection distance #42

Open
tom131313 opened this issue Nov 14, 2024 · 2 comments
Open

Default AprilTagDetector has very limited tag detection distance #42

tom131313 opened this issue Nov 14, 2024 · 2 comments

Comments

@tom131313
Copy link

tom131313 commented Nov 14, 2024

2025 beta 1 has AprilTagDetector QuadThresholdParameters minClusterPixels = 300 up from the previous library value of 5. This results in a very limited detection range that is roughly 1/3 to 1/4 the previous range depending on the resolution.

I don't find any documentation of why this was changed and I must set the parameter in code back to 5 to get a useful detector. (I don't consider 3 feet range at my 320x240 a useful default and it was hard to figure out the change without change-log documentation.)

[criticalAngle was also changed for unknown reasons but that doesn't seem to affect detections in my limited testing.]

[My team 10473 is a very low resource rookie team that intends to use AprilTag detection on the roboRIO v2, if possible. AprilTag detector performance tuning hints are appreciated.]

@PeterJohnson
Copy link
Member

PeterJohnson commented Nov 14, 2024

This was changed as a result of discussions stemming from wpilibsuite/allwpilib#4920. The problem with the default value previously was it allowed too much noise in the result. 200 was originally suggested, but it ended up as 300 when ultimately merged (following a brief discussion in wpilibsuite/allwpilib#5896). The idea was that the defaults should be stricter to give better results, and teams can tune them to be looser if different behavior is desired and they're knowingly making the tradeoff between noise and distance capability.

@tom131313
Copy link
Author

The idea to highlight tuning possibilities is laudable except it was a painful undocumented breaking change. Also, neither the WPILib documentation of AprilTag Adjustable Parameters nor the referenced AprilRobotics documentation mention minimum pixels.

I am interested in the source of noise that some think is excessive and how it is manifest in detections. I haven't seen it unless you are referring to the glare in some arenas and varying lighting, otherwise, all the tags seemed to be in pristine condition. I haven't seen many frames not have their tags detected correctly and essentially none of the failures had the tag id wrong. (I'm ignoring no detections because of movement of a rolling shutter camera - that is largely a solvable problem with a global shutter.)

https://docs.wpilib.org/en/latest/docs/software/vision-processing/apriltag/apriltag-intro.html#adjustable-parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants