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

Better documentation for Camera Intrinsics and Distortion parameters. #184

Open
TommasoBendinelli opened this issue Jul 26, 2022 · 7 comments

Comments

@TommasoBendinelli
Copy link

Hello,
I have just stumbled into these file: https://github.com/zivid/zivid-python/blob/master/modules/zivid/camera_intrinsics.py
Camera Instrinsics and Distortion parameters are quite useful for a lot of applications and should be documented better.

Best

@eskaur
Copy link
Member

eskaur commented Jul 26, 2022

Hi!

First of all, if you are wondering how to retrieve intrinsics from a camera, look here:
https://github.com/zivid/zivid-python/blob/master/modules/zivid/experimental/calibration.py

If you are looking for documentation on how to interpret the values, then I agree it could be better. Long story short, it is the "Standard OpenCV model" intrinsics:
https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html

@TommasoBendinelli
Copy link
Author

TommasoBendinelli commented Jul 27, 2022

I tried to match the parameters got from Zivid calibration.py against the one I have obtained with CalibrateCamera from OpenCV and the parameter values are completely different. Are unit of measurements different somehow?

@diviz-imas
Copy link

Hi Tommaso!

There should be no difference in units. The Brown distortion model uses unitless parameters that work in normalized coordinates.

Can you share the two sets of parameters for reference?

@TommasoBendinelli
Copy link
Author

Actually, it was an issue on my side. Sorry about that. I made a small bug in the code, which resulted in wrong values.
Now my values and the ones from Zivid SDK are much closer:
Zivid:
{"_k1": -0.08929276466369629, "_k2": 0.11623617261648178, "_k3": -0.03393297642469406, "_p1": -0.0004479888884816319, "_p2": -0.00011812106822617352, "_cx": 969.7472534179688, "_cy": 592.1499633789062, "_fx": 1778.913330078125, "_fy": 1778.9261474609375}
OpenCV:
{"_k1": -0.07816818141757419, "_k2": 0.06866144436678583, "_k3": -0.024689114436057036, "_p1": 0.00016911156978288228, "_p2": -0.0004692102909033517, "_cx": 959.6700426181453, "_cy": 592.86066030548, "_fx": 1,776.7353645734295, "_fy": 1,779.8388818694884}

How are the Zivid values computed? Are these parameters uniquely computed for each Zivid camera you produce, or are they fixed for all Zivid II cameras? I am wondering whether I should trust the ones obtained from the Zivid SDK more, or the ones that I compute via calibration. Thanks!

@diviz-imas
Copy link

All Zivid cameras are individually calibrated over a wide range of temperatures and aperture values with a high-end calibration process and custom algorithms. My recommendation is to trust the ones from Zivid SDK.

@TommasoBendinelli
Copy link
Author

TommasoBendinelli commented Jul 28, 2022

Thanks for this relevant info! It would make sense to add it into the documentation

@diviz-imas
Copy link

Thanks for the feedback Tommaso. We'll see what we can do to improve the docs.

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

No branches or pull requests

3 participants