% Intrinsic and Extrinsic Camera Parameters
%
% This script file can be directly excecuted under Matlab to recover the camera intrinsic and extrinsic parameters.
% IMPORTANT: This file contains neither the structure of the calibration objects nor the image coordinates of the calibration points.
%            All those complementary variables are saved in the complete matlab data file Calib_Results.mat.
% For more information regarding the calibration model visit http://www.vision.caltech.edu/bouguetj/calib_doc/


%-- Focal length:
fc = [ 192.658927509624930 ; 192.572736801235040 ];

%-- Principal point:
cc = [ 156.736642088328100 ; 128.020332671336630 ];

%-- Skew coefficient:
alpha_c = 0.000000000000000;

%-- Distortion coefficients:
kc = [ -0.359604267557413 ; 0.172051859103319 ; -0.001452856147174 ; -0.001627249236614 ; 0.000000000000000 ];

%-- Focal length uncertainty:
fc_error = [ 5.335312916748743 ; 5.434611736797789 ];

%-- Principal point uncertainty:
cc_error = [ 3.740395576173810 ; 2.959829583046050 ];

%-- Skew coefficient uncertainty:
alpha_c_error = 0.000000000000000;

%-- Distortion coefficients uncertainty:
kc_error = [ 0.030838024619380 ; 0.073596771952029 ; 0.003249905902169 ; 0.003656653290103 ; 0.000000000000000 ];

%-- Image size:
nx = 320;
ny = 240;


%-- Various other variables (may be ignored if you do not use the Matlab Calibration Toolbox):
%-- Those variables are used to control which intrinsic parameters should be optimized

n_ima = 12;						% Number of calibration images
est_fc = [ 1 ; 1 ];					% Estimation indicator of the two focal variables
est_aspect_ratio = 1;				% Estimation indicator of the aspect ratio fc(2)/fc(1)
center_optim = 1;					% Estimation indicator of the principal point
est_alpha = 0;						% Estimation indicator of the skew coefficient
est_dist = [ 1 ; 1 ; 1 ; 1 ; 0 ];	% Estimation indicator of the distortion coefficients


%-- Extrinsic parameters:
%-- The rotation (omc_kk) and the translation (Tc_kk) vectors for every calibration image and their uncertainties

%-- Image #1:
omc_1 = [ -2.141485e+000 ; -2.079277e+000 ; -2.780375e-002 ];
Tc_1  = [ -1.077859e+002 ; -1.074653e+002 ; 3.782065e+002 ];
omc_error_1 = [ 1.416074e-002 ; 1.373603e-002 ; 2.806333e-002 ];
Tc_error_1  = [ 7.410087e+000 ; 5.914082e+000 ; 1.123499e+001 ];

%-- Image #2:
omc_2 = [ 2.449452e+000 ; 1.854652e+000 ; -2.561927e-001 ];
Tc_2  = [ -1.300925e+002 ; -1.215474e+002 ; 3.920280e+002 ];
omc_error_2 = [ 1.192702e-002 ; 1.364638e-002 ; 2.896506e-002 ];
Tc_error_2  = [ 7.695098e+000 ; 6.073004e+000 ; 1.166672e+001 ];

%-- Image #3:
omc_3 = [ -2.584221e+000 ; -1.350598e+000 ; -2.561188e-001 ];
Tc_3  = [ -9.106677e+001 ; -5.960551e+001 ; 3.320481e+002 ];
omc_error_3 = [ 1.534803e-002 ; 1.087440e-002 ; 2.433209e-002 ];
Tc_error_3  = [ 6.591706e+000 ; 5.177607e+000 ; 9.727676e+000 ];

%-- Image #4:
omc_4 = [ -1.970615e+000 ; -2.413787e+000 ; 1.069721e-001 ];
Tc_4  = [ -3.062556e+001 ; -1.465829e+002 ; 3.750362e+002 ];
omc_error_4 = [ 1.348812e-002 ; 1.455265e-002 ; 2.812356e-002 ];
Tc_error_4  = [ 7.405245e+000 ; 5.764762e+000 ; 1.084137e+001 ];

%-- Image #5:
omc_5 = [ 2.411838e+000 ; 1.981982e+000 ; -3.246709e-001 ];
Tc_5  = [ -1.245687e+002 ; -7.842888e+001 ; 4.326704e+002 ];
omc_error_5 = [ 1.256750e-002 ; 1.378379e-002 ; 3.038570e-002 ];
Tc_error_5  = [ 8.370129e+000 ; 6.649171e+000 ; 1.258879e+001 ];

%-- Image #6:
omc_6 = [ -1.945463e+000 ; -2.326770e+000 ; -1.259920e-001 ];
Tc_6  = [ -8.529542e+001 ; -1.086617e+002 ; 3.800826e+002 ];
omc_error_6 = [ 1.280056e-002 ; 1.617650e-002 ; 2.861159e-002 ];
Tc_error_6  = [ 7.492779e+000 ; 5.954687e+000 ; 1.114994e+001 ];

%-- Image #7:
omc_7 = [ -2.519188e+000 ; -1.740409e+000 ; 2.402297e-002 ];
Tc_7  = [ -1.101529e+002 ; -7.043768e+001 ; 3.895675e+002 ];
omc_error_7 = [ 1.588358e-002 ; 1.100734e-002 ; 3.013817e-002 ];
Tc_error_7  = [ 7.611817e+000 ; 6.038470e+000 ; 1.149661e+001 ];

%-- Image #8:
omc_8 = [ 2.428144e+000 ; 1.874677e+000 ; -2.869865e-001 ];
Tc_8  = [ -1.198419e+002 ; -2.765691e+001 ; 4.211478e+002 ];
omc_error_8 = [ 1.438319e-002 ; 1.279919e-002 ; 2.988253e-002 ];
Tc_error_8  = [ 8.117101e+000 ; 6.471661e+000 ; 1.231227e+001 ];

%-- Image #9:
omc_9 = [ -1.894647e+000 ; -1.794169e+000 ; 6.543802e-001 ];
Tc_9  = [ -3.542659e+001 ; -8.846010e+001 ; 5.037276e+002 ];
omc_error_9 = [ 1.626559e-002 ; 1.230242e-002 ; 2.343642e-002 ];
Tc_error_9  = [ 9.798579e+000 ; 7.668821e+000 ; 1.240060e+001 ];

%-- Image #10:
omc_10 = [ 2.515759e+000 ; 1.640288e+000 ; -6.696331e-001 ];
Tc_10  = [ -1.393847e+002 ; -9.124379e+001 ; 5.814179e+002 ];
omc_error_10 = [ 1.277985e-002 ; 1.528021e-002 ; 3.129366e-002 ];
Tc_error_10  = [ 1.132980e+001 ; 8.971134e+000 ; 1.618293e+001 ];

%-- Image #11:
omc_11 = [ NaN ; NaN ; NaN ];
Tc_11  = [ NaN ; NaN ; NaN ];
omc_error_11 = [ NaN ; NaN ; NaN ];
Tc_error_11  = [ NaN ; NaN ; NaN ];

%-- Image #12:
omc_12 = [ -2.614186e+000 ; -1.681714e+000 ; 2.111911e-001 ];
Tc_12  = [ -1.446011e+002 ; -1.075586e+002 ; 5.105850e+002 ];
omc_error_12 = [ 2.005664e-002 ; 9.401522e-003 ; 3.577189e-002 ];
Tc_error_12  = [ 9.956706e+000 ; 7.912705e+000 ; 1.506235e+001 ];

