spoonsso / dannce

MIT License
214 stars 30 forks source link

Camera Calibration with MATLAB Camera Calibrator App #87

Closed verpeutlab closed 2 years ago

verpeutlab commented 2 years ago

Hello, I learned that it is recommended to use the MATLAB Camera Calibrator App to calibrate my cameras in the issue titled "Markers drift between cameras sub-groups." When I was done using this app for each camera I am using, I chose the option that generates a MATLAB script of the camera parameters. However, the parameters generated from this app appear to be organized differently than the parameters generated by the scripts provided for calibration in DANNCE. Is there a way for me to re-organize these camera parameters so that I can test these parameters with Label3D? Thank you!

diegoaldarondo commented 2 years ago

You can access the required parameters in the cameraParameters object. You'll eventually need the intrinsic matrix (k) radial and tangential distortion, rotation matrix and translation vector.

Be aware that for your purposes, the app only does intrinsic calibration. You'll need to do your extrinsic calibration using the intrinsic parameters estimated from the app.

verpeutlab commented 2 years ago

Thank you for your response! I have the intrinsic matrix, radial distortion, and tangential distortion of the cameras. However, there are different values for the rotation matrix and translation vector for each checkerboard image that was imported into the MATLAB Camera Calibration App. Additionally, each value has different uncertainties, which are absent when these parameters are generated from the calibration script provided by DANNCE. How should I use the rotation matrix and translation vector values generated by the MATLAB Camera Calibration App to determine the Radial Distortion and the Tangential Distortion for each camera using the script convertCalibration.m provided in DANNCE? Or, is there another way for me to finish calibrating if I used the MATLAB Camera Calibration App? Thank you!

spoonsso commented 2 years ago

When you say,

However, there are different values for the rotation matrix and translation vector for each checkerboard image that was imported into the MATLAB Camera Calibration App

Do you mean that each camera has different values for these variables? That would be expected.

I am a bit confused about which step you are on. convertCalibration.m will only work for calibrations in the worldcoordinates_lframe.mat, which are generated by the DANNCE calibration script.

Furthermore, you say,

I have the intrinsic matrix, radial distortion, and tangential distortion of the cameras.

But then later,

How should I use the rotation matrix and translation vector values generated by the MATLAB Camera Calibration App to determine the Radial Distortion and the Tangential Distortion for each camera

If you already have the radial and tangential distortions for each camera, then you shouldn't need to calculate them again.