I have calibrated data - camera parameters (attached below). How do I use this to set the Physical Camera parameters in Unity to recreate my real life camera?
My confusions are specifically:
- How to add focal length?
Camera (intrinsic matrix) is the above, which has
- → a principal point that is usually at the image center
- → are the focal lengths expressed in pixel units.
The focal length in Unity (I suspect) can’t be in pixel units. Is there some way of retrieving focal length in meters from focal length expressed in pixel units?
-
Is the Sensor Size the same as cx, cy → principal point?
I notice that if I change my Sensor size, even if my focal length is fixed, the field of view changes, so it seems strange to me. Shouldn’t FOV always be fixed for a fixed focal length? -
What part of the camera parameters from OpenCV correspond to lens shift? Or is that assumed to be some default value?
-
I am guessing the answer to this is No - Can you model distortion parameters into Unity camera?
Source - Open CV : Camera calibration Camera Calibration and 3D Reconstruction — OpenCV 2.4.13.7 documentation
Thank you!
Camera
#YAML File
CAMERA Parameters from OpenCV
image_width: 0
image_height: 1080
camera_name: left
camera_matrix:
rows: 3
cols: 3
data: [1643.55164017145, 0, 833.842174850277, 0, 1632.81195514379, 657.989554730761, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
rows: 1
cols: 5
data: [-0.40444238705588, 0.581618979028972, -0.00497978193873161, 0.00232175743375933, -0.215474790066087]
rectification_matrix:
rows: 3
cols: 3
data: [0.9987597352703238, 0.03749814884259891, 0.0327548475211089, -0.03730056012128149, 0.999282144850663, -0.006622929661203378, -0.03297968188735999, 0.00539294131591293, 0.9994414724067496]
projection_matrix:
rows: 3
cols: 4
data: [1199.817340845223, 0, 810.3841648101807, 0, 0, 1199.817340845223, 711.4899749755859, 0, 0, 0, 1, 0]