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

Camera calibration parameters format #62

Open
clement-joly opened this issue Aug 16, 2019 · 1 comment
Open

Camera calibration parameters format #62

clement-joly opened this issue Aug 16, 2019 · 1 comment

Comments

@clement-joly
Copy link

Hi, I can't figure out how to update the reprojection parameters in the camera yaml file.

Here is what I'm doing: I'm trying to run the OKVIS sample.
Before running it I'm trying to update the camera calibration parameters in config/config_mynteye.yaml as suggested in the OKVIS SLAM documentation.
After running "./samples/_output/bin/tutorials/get_img_params" and getting the output I can't figure out where to get the reprojection parameters from (distortion parameters, focal length and principal point are easy to figure out).

Here is what ./get_img_params outputs:

I/get_img_params.cc:44 Intrinsics left: {equidistant, width: 752, height: 480, k2: -0.02792783570059486, k3: 0.01786521154646784, k4: -0.02664344274294007, k5: 0.01070160112850720, mu: 367.99913111190255677, mv: 367.81784687988840687, u0: 374.05615779570649693, v0: 240.30372535340484319}
I/get_img_params.cc:45 Intrinsics right: {equidistant, width: 752, height: 480, k2: -0.02414661189360028, k3: 0.00185208096833369, k4: -0.00304351025845435, k5: -0.00024005929378344, mu: 366.68144499080142396, mv: 366.76898727690240776, u0: 388.11237425751852470, v0: 236.91823718560618772}
I/get_img_params.cc:46 Extrinsics right to left: {rotation: [0.99995681220526167, 0.00152430418018631, -0.00916789076381803, -0.00157537598817912, 0.99998326829449113, -0.00556608673698824, 0.00915925296008916, 0.00558028922494831, 0.99994248257456242], translation: [-120.42460893053265636, -0.02764270343508017, -0.49606529118166043]}
ROSMsgInfoPair:
left:
width: 640, height: 400
distortion_model: PINHOLE
D: -0.250348,0.0505794,-0.000705367,-0.00852555,0,
K: 362.201,0,363.501,0,406.587,234.352,0,0,1,
R: 0.995541,0.00317344,0.0942805,-0.00350544,0.999988,0.00335595,-0.0942688,-0.00367148,0.99554,
P: 349.09,0,374.036,0,0,349.09,251.158,0,0,0,1,0,

right:
width: 640, height: 400
distortion_model: PINHOLE
D: -0.250348,0.0505794,-0.000705367,-0.00852555,0,
K: 362.201,0,363.501,0,406.587,234.352,0,0,1,
R: 0.999013,0.00980714,0.04333,-0.00967418,0.999948,-0.00327717,-0.0433599,0.00285476,0.999055,
P: 349.09,0,374.036,-41940.9,0,349.09,251.158,0,0,0,1,0,

And here is the format of the yaml file that I need to update:

cameras:
    - {T_SC:
       [-0.00702012, -0.99996421, -0.00472216, 0.00397678,
        0.99997478, -0.00702512, 0.0010427, -0.04320474,
        -0.00107584, -0.00471472, 0.99998831, 0.02690585,
          0.0, 0.0, 0.0, 1.0],
       image_dimension: [752, 480],
       distortion_coefficients: [-3.0528777663428153e-01, 8.1448686969566128e-02, 4.2202500511119567e-04, 4.3984930436069997e-04],
       distortion_type: radialtangential,
       focal_length: [3.5930674755329585e+02, 3.6049533700817784e+02],
       principal_point: [3.8914180654924951e+02, 2.5282994170020979e+02]}

    - {T_SC:
       [ 0.00190458, -0.99999508, -0.0024922, 0.00337758,
        0.99999677, 0.00190877, -0.00167832, 0.07660769,
        0.00168307, -0.002489, 0.99999549, 0.02699279,
          0.0, 0.0, 0.0, 1.0],
       image_dimension: [752, 480],
       distortion_coefficients: [-3.0291415447136244e-01, 8.1192486081665002e-02, -3.0849058731388272e-04, 2.3295083728201271e-04],
       distortion_type: radialtangential,
       focal_length: [3.5693477648078687e+02, 3.5803785465032320e+02],
       principal_point: [3.7966613895215522e+02, 2.5597274516015744e+02]}

How do I update the two 4x4 matrices above (after T_SC)?

I've also tried to generate the yaml file directly by running
./tools/_output/bin/writer/img_params_writer tools/writer/config/img.params
but I get a segmentation error ... any idea why?

I/utils.cc:35 Detecting MYNT EYE devices
Segmentation fault

I'm running this on an ARM platform (Odroid XU4, Ubuntu 16.04.4 LTS)
Thanks!

@alter-sachin
Copy link

Were you able to find a way ?

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