% 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 = [ 662.494934979637040 ; 664.676932398361150 ];

%-- Principal point:
cc = [ 306.512376143758330 ; 241.751091927483150 ];

%-- Skew coefficient:
alpha_c = 0.000000000000000;

%-- Distortion coefficients:
kc = [ -0.279074670322585 ; 0.320242173461322 ; 0.000504345180465 ; 0.000278170211802 ; 0.000000000000000 ];

%-- Focal length uncertainty:
fc_error = [ 1.433933208177148 ; 1.542535323757052 ];

%-- Principal point uncertainty:
cc_error = [ 2.834706996328200 ; 2.608159988073601 ];

%-- Skew coefficient uncertainty:
alpha_c_error = 0.000000000000000;

%-- Distortion coefficients uncertainty:
kc_error = [ 0.011436155947378 ; 0.047291028886170 ; 0.000643505776621 ; 0.000669372382059 ; 0.000000000000000 ];

%-- Image size:
nx = 640;
ny = 480;


%-- 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 = 20;						% 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 = [ 1.653090e+000 ; 1.646178e+000 ; -6.680990e-001 ];
Tc_1  = [ -1.821782e+002 ; -8.239176e+001 ; 8.580038e+002 ];
omc_error_1 = [ 3.288613e-003 ; 4.270594e-003 ; 5.442255e-003 ];
Tc_error_1  = [ 3.684905e+000 ; 3.402853e+000 ; 1.921708e+000 ];

%-- Image #2:
omc_2 = [ 1.845815e+000 ; 1.894594e+000 ; -3.972582e-001 ];
Tc_2  = [ -1.590959e+002 ; -1.580457e+002 ; 7.631118e+002 ];
omc_error_2 = [ 3.488831e-003 ; 4.285585e-003 ; 6.636909e-003 ];
Tc_error_2  = [ 3.295774e+000 ; 3.025383e+000 ; 1.885728e+000 ];

%-- Image #3:
omc_3 = [ 1.739433e+000 ; 2.071100e+000 ; -5.057413e-001 ];
Tc_3  = [ -1.294259e+002 ; -1.732493e+002 ; 7.811307e+002 ];
omc_error_3 = [ 3.192233e-003 ; 4.537843e-003 ; 6.861452e-003 ];
Tc_error_3  = [ 3.370181e+000 ; 3.096034e+000 ; 1.809949e+000 ];

%-- Image #4:
omc_4 = [ 1.826231e+000 ; 2.110301e+000 ; -1.097721e+000 ];
Tc_4  = [ -6.870999e+001 ; -1.535713e+002 ; 7.842733e+002 ];
omc_error_4 = [ 2.858048e-003 ; 4.661689e-003 ; 6.368078e-003 ];
Tc_error_4  = [ 3.387719e+000 ; 3.088257e+000 ; 1.460257e+000 ];

%-- Image #5:
omc_5 = [ 1.078224e+000 ; 1.917308e+000 ; -2.539015e-001 ];
Tc_5  = [ -9.646956e+001 ; -2.278802e+002 ; 7.423960e+002 ];
omc_error_5 = [ 2.784105e-003 ; 4.349459e-003 ; 4.893516e-003 ];
Tc_error_5  = [ 3.235060e+000 ; 2.948875e+000 ; 1.780553e+000 ];

%-- Image #6:
omc_6 = [ -1.699614e+000 ; -1.931158e+000 ; -7.983270e-001 ];
Tc_6  = [ -1.513182e+002 ; -7.884732e+001 ; 4.482441e+002 ];
omc_error_6 = [ 2.710119e-003 ; 4.357575e-003 ; 5.888999e-003 ];
Tc_error_6  = [ 1.936899e+000 ; 1.820552e+000 ; 1.528498e+000 ];

%-- Image #7:
omc_7 = [ 1.991863e+000 ; 1.931445e+000 ; 1.314183e+000 ];
Tc_7  = [ -8.548735e+001 ; -7.711230e+001 ; 4.453935e+002 ];
omc_error_7 = [ 5.132806e-003 ; 2.638256e-003 ; 6.158518e-003 ];
Tc_error_7  = [ 1.954972e+000 ; 1.787490e+000 ; 1.613342e+000 ];

%-- Image #8:
omc_8 = [ 1.958143e+000 ; 1.824826e+000 ; 1.327689e+000 ];
Tc_8  = [ -1.733093e+002 ; -1.029942e+002 ; 4.679402e+002 ];
omc_error_8 = [ 4.862442e-003 ; 2.676220e-003 ; 5.874954e-003 ];
Tc_error_8  = [ 2.148749e+000 ; 1.946400e+000 ; 1.815752e+000 ];

%-- Image #9:
omc_9 = [ -1.368193e+000 ; -1.987334e+000 ; 3.162268e-001 ];
Tc_9  = [ -5.743025e+000 ; -2.242267e+002 ; 7.354491e+002 ];
omc_error_9 = [ 3.342594e-003 ; 4.284449e-003 ; 5.571293e-003 ];
Tc_error_9  = [ 3.193939e+000 ; 2.906206e+000 ; 1.851836e+000 ];

%-- Image #10:
omc_10 = [ -1.518484e+000 ; -2.092997e+000 ; 1.820977e-001 ];
Tc_10  = [ -3.435579e+001 ; -2.991285e+002 ; 8.674984e+002 ];
omc_error_10 = [ 4.083260e-003 ; 4.883596e-003 ; 7.449604e-003 ];
Tc_error_10  = [ 3.836178e+000 ; 3.452352e+000 ; 2.459906e+000 ];

%-- Image #11:
omc_11 = [ -1.792271e+000 ; -2.066014e+000 ; -4.884743e-001 ];
Tc_11  = [ -1.549224e+002 ; -2.338246e+002 ; 7.092835e+002 ];
omc_error_11 = [ 3.661617e-003 ; 4.600490e-003 ; 7.918521e-003 ];
Tc_error_11  = [ 3.138759e+000 ; 2.952571e+000 ; 2.425091e+000 ];

%-- Image #12:
omc_12 = [ -1.837717e+000 ; -2.088344e+000 ; -5.240862e-001 ];
Tc_12  = [ -1.367769e+002 ; -1.759973e+002 ; 6.089285e+002 ];
omc_error_12 = [ 3.142777e-003 ; 4.448650e-003 ; 7.341039e-003 ];
Tc_error_12  = [ 2.672242e+000 ; 2.493960e+000 ; 2.029733e+000 ];

%-- Image #13:
omc_13 = [ -1.917005e+000 ; -2.117198e+000 ; -6.024010e-001 ];
Tc_13  = [ -1.356618e+002 ; -1.425080e+002 ; 5.486138e+002 ];
omc_error_13 = [ 2.944924e-003 ; 4.413075e-003 ; 7.217454e-003 ];
Tc_error_13  = [ 2.400102e+000 ; 2.233232e+000 ; 1.844626e+000 ];

%-- Image #14:
omc_14 = [ -1.952778e+000 ; -2.125633e+000 ; -5.928964e-001 ];
Tc_14  = [ -1.262550e+002 ; -1.362108e+002 ; 4.945989e+002 ];
omc_error_14 = [ 2.763972e-003 ; 4.306046e-003 ; 7.048051e-003 ];
Tc_error_14  = [ 2.168021e+000 ; 2.013107e+000 ; 1.656544e+000 ];

%-- Image #15:
omc_15 = [ -2.110890e+000 ; -2.256300e+000 ; -4.850643e-001 ];
Tc_15  = [ -2.019785e+002 ; -1.344809e+002 ; 4.852062e+002 ];
omc_error_15 = [ 3.185278e-003 ; 3.969650e-003 ; 7.641628e-003 ];
Tc_error_15  = [ 2.168724e+000 ; 2.022062e+000 ; 1.771866e+000 ];

%-- Image #16:
omc_16 = [ 1.885473e+000 ; 2.332090e+000 ; -1.540370e-001 ];
Tc_16  = [ -1.970894e+001 ; -1.696452e+002 ; 7.011381e+002 ];
omc_error_16 = [ 4.304407e-003 ; 4.538435e-003 ; 9.163623e-003 ];
Tc_error_16  = [ 3.023826e+000 ; 2.753440e+000 ; 2.113519e+000 ];

%-- Image #17:
omc_17 = [ -1.613391e+000 ; -1.956913e+000 ; -3.563780e-001 ];
Tc_17  = [ -1.378878e+002 ; -1.380247e+002 ; 4.934341e+002 ];
omc_error_17 = [ 2.723195e-003 ; 4.144426e-003 ; 5.843184e-003 ];
Tc_error_17  = [ 2.139445e+000 ; 1.995964e+000 ; 1.476338e+000 ];

%-- Image #18:
omc_18 = [ -1.344915e+000 ; -1.706740e+000 ; -3.090744e-001 ];
Tc_18  = [ -1.864263e+002 ; -1.563238e+002 ; 4.488225e+002 ];
omc_error_18 = [ 3.083468e-003 ; 4.041420e-003 ; 4.624624e-003 ];
Tc_error_18  = [ 1.962426e+000 ; 1.836927e+000 ; 1.420866e+000 ];

%-- Image #19:
omc_19 = [ -1.923525e+000 ; -1.840209e+000 ; -1.442395e+000 ];
Tc_19  = [ -1.090634e+002 ; -7.909525e+001 ; 3.393733e+002 ];
omc_error_19 = [ 2.681313e-003 ; 4.684466e-003 ; 5.921351e-003 ];
Tc_error_19  = [ 1.523883e+000 ; 1.403508e+000 ; 1.346865e+000 ];

%-- Image #20:
omc_20 = [ 1.892440e+000 ; 1.593457e+000 ; 1.472738e+000 ];
Tc_20  = [ -1.467525e+002 ; -8.765024e+001 ; 4.019021e+002 ];
omc_error_20 = [ 4.927824e-003 ; 2.736300e-003 ; 5.315676e-003 ];
Tc_error_20  = [ 1.866103e+000 ; 1.668671e+000 ; 1.624026e+000 ];

