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

Document Setting FOV for non-AprilTag Pipelines #1270

Open
randomstring opened this issue Mar 10, 2024 · 4 comments
Open

Document Setting FOV for non-AprilTag Pipelines #1270

randomstring opened this issue Mar 10, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@randomstring
Copy link

The documentation on how to calibrate the accuracy of the pitch and yaw of objects in object detection mode is lacking. There's one "Hint" that simply states "hey, you better get you FOV correct if you want accurate results."

Experimenting with changing the camera FOV on the camera settings page does indeed change the scaling of Pitch and Yaw angles returned.

Calibrating the camera resolution does not effect pitch/yaw reading for Object Detection.

Seems like having a separate horizontal and vertical FOV could make this more accurate.

This applies to all non-AprilTag pipelines.

Question: is the pitch/yaw computation done before or after the 640x640 scaling? I don't know how it works under the hood, but there would be a big difference in pitch/yaw if you apply the diagonal FOV to a 640x480 image vs a stretched 640x640 image.

Seems like the most accurate way to do it is to scale target pixel from the 640x640 image back to the original resolution and then use the camera calibration to correct for lens distortion before calculating the target pitch/yaw.

@randomstring randomstring added the bug Something isn't working label Mar 10, 2024
@mcm001
Copy link
Contributor

mcm001 commented Mar 10, 2024

PItch/yaw is calculated in original image space, not letterboxed/resized space yeah. We don't undistort, tho #1250 does but I dont want to merge this late in the season.

It looks like when importing calibrations, we need to make sure that calculateFrameStaticProps() gets propogated up the chain -- otherwise it will take changing the video mode to get the new calibration to apply. but calibration absolutely changes the pitch/yaw reported in my testing. Can you make sure your testing is right?

@randomstring
Copy link
Author

otherwise it will take changing the video mode to get the new calibration to apply.

Do you mean switch from 640x480 to another resolution and back? or from Object Detection to AprilTags and back?

We'll give this a try on Monday.

@mcm001
Copy link
Contributor

mcm001 commented Mar 11, 2024

I believe any pipeline or resolution switch will cause camera parameters to get recalculated (or pulled from calibration data)

@randomstring
Copy link
Author

We did not notice a change in results (it may have just been a small change) after switching pipelines with the camera calibration. The calibration measured a diagonal FOV of 107 deg and we were using a calculated diagonal FOV of 120 deg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants