Skip to content

Commit

Permalink
1st
Browse files Browse the repository at this point in the history
  • Loading branch information
ysawa0 committed Jun 11, 2015
1 parent fe65d7e commit cf92f4f
Show file tree
Hide file tree
Showing 55 changed files with 3,880 additions and 0 deletions.
106 changes: 106 additions & 0 deletions Calib_Results_l.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
c% 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 = [ 1843.463722950638200 ; 1831.060188472588600 ];
camL.f = mean(fc);
%-- Principal point:
cc = [ 1457.180947340274300 ; 907.728368229318560 ];
camL.c = cc';
%-- Skew coefficient:
alpha_c = 0.000000000000000;

%-- Distortion coefficients:
kc = [ -0.067660205164109 ; 0.042540411513189 ; 0.004864952869793 ; 0.013957385530073 ; 0.000000000000000 ];

%-- Focal length uncertainty:
fc_error = [ 33.349812118312649 ; 29.525699655280665 ];

%-- Principal point uncertainty:
cc_error = [ 55.834372877013024 ; 48.799936036275909 ];

%-- Skew coefficient uncertainty:
alpha_c_error = 0.000000000000000;

%-- Distortion coefficients uncertainty:
kc_error = [ 0.090252344111123 ; 0.411098571762569 ; 0.007510227085346 ; 0.010183003306672 ; 0.000000000000000 ];

%-- Image size:
nx = 2736;
ny = 1824;


%-- 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 = 8; % 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.879510e+00 ; 1.687184e+00 ; 1.901256e-01 ];
Tc_1l = [ -8.540793e+02 ; -2.157167e+01 ; 2.936587e+03 ];
omc_error_1 = [ 2.213462e-02 ; 1.969724e-02 ; 3.010863e-02 ];
Tc_error_1 = [ 9.032617e+01 ; 8.023056e+01 ; 5.330009e+01 ];
camL.R = rodrigues(omc_1);

%-- Image #2:
omc_2 = [ 2.049945e+00 ; 1.944643e+00 ; -1.165775e-01 ];
Tc_2l = [ -8.030443e+02 ; -2.979610e+01 ; 2.765212e+03 ];
omc_error_2 = [ 1.615558e-02 ; 2.051560e-02 ; 3.673551e-02 ];
Tc_error_2 = [ 8.442238e+01 ; 7.544382e+01 ; 5.022878e+01 ];
rot2l = rodrigues(omc_2);

%-- Image #3:
omc_3 = [ 1.732265e+00 ; 1.631841e+00 ; 5.290559e-01 ];
Tc_3l = [ -6.654649e+02 ; -8.361448e+01 ; 2.703608e+03 ];
omc_error_3 = [ 2.623836e-02 ; 1.941570e-02 ; 2.898709e-02 ];
Tc_error_3 = [ 8.287193e+01 ; 7.346829e+01 ; 4.985002e+01 ];
rot3l = rodrigues(omc_3);

%-- Image #4:
omc_4 = [ 1.601439e+00 ; 1.414153e+00 ; 6.220053e-01 ];
Tc_4l = [ -6.799458e+02 ; -8.644288e+01 ; 2.533102e+03 ];
omc_error_4 = [ 2.666201e-02 ; 2.009638e-02 ; 2.690166e-02 ];
Tc_error_4 = [ 7.799865e+01 ; 6.913201e+01 ; 4.845157e+01 ];
rot4l = rodrigues(omc_4);

%-- Image #5:
omc_5 = [ 1.590094e+00 ; 1.187457e+00 ; -3.800128e-01 ];
Tc_5l = [ -8.006268e+02 ; 2.129944e+02 ; 2.974221e+03 ];
omc_error_5 = [ 2.027786e-02 ; 2.414776e-02 ; 2.718525e-02 ];
Tc_error_5 = [ 9.072663e+01 ; 8.174456e+01 ; 5.139105e+01 ];
rot5l = rodrigues(omc_5);

%-- Image #6:
omc_6 = [ 1.574815e+00 ; 1.513031e+00 ; -7.845723e-01 ];
Tc_6l = [ -7.110940e+02 ; 2.260673e+02 ; 2.971214e+03 ];
omc_error_6 = [ 1.634604e-02 ; 2.647419e-02 ; 2.969011e-02 ];
Tc_error_6 = [ 9.015059e+01 ; 8.119818e+01 ; 4.744411e+01 ];
rot6l = rodrigues(omc_6);

%-- Image #7:
omc_7 = [ 1.891751e+00 ; 1.822540e+00 ; -2.943902e-01 ];
Tc_7l = [ -7.533645e+02 ; 5.286941e+00 ; 2.675951e+03 ];
omc_error_7 = [ 1.529110e-02 ; 2.198528e-02 ; 3.250962e-02 ];
Tc_error_7 = [ 8.139810e+01 ; 7.296912e+01 ; 4.753174e+01 ];
rot7l = rodrigues(omc_7);

%-- Image #8:
omc_8 = [ 1.789978e+00 ; 1.707083e+00 ; -8.646353e-02 ];
Tc_8l = [ -6.621884e+02 ; -3.455917e+01 ; 2.838446e+03 ];
omc_error_8 = [ 1.915876e-02 ; 2.173883e-02 ; 3.106638e-02 ];
Tc_error_8 = [ 8.642065e+01 ; 7.679839e+01 ; 4.992620e+01 ];
rot8l = rodrigues(omc_8);
106 changes: 106 additions & 0 deletions Calib_Results_r.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
% 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 = [ 1834.982566594790100 ; 1840.126401445344300 ];
camR.f = mean(fc);
%-- Principal point:
cc = [ 1463.788543422015700 ; 991.790475398290940 ];
camR.c = cc';
%-- Skew coefficient:
alpha_c = 0.000000000000000;

%-- Distortion coefficients:
kc = [ -0.074779317538046 ; -0.522802216877433 ; 0.014687197515514 ; 0.023315526928305 ; 0.000000000000000 ];

%-- Focal length uncertainty:
fc_error = [ 25.594133302552933 ; 21.459492601564090 ];

%-- Principal point uncertainty:
cc_error = [ 33.844910328384202 ; 29.264908432020416 ];

%-- Skew coefficient uncertainty:
alpha_c_error = 0.000000000000000;

%-- Distortion coefficients uncertainty:
kc_error = [ 0.087732514713999 ; 1.076571463104891 ; 0.004711084530169 ; 0.005451014543039 ; 0.000000000000000 ];

%-- Image size:
nx = 2736;
ny = 1824;


%-- 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 = 8; % 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.109946e+00 ; 2.179564e+00 ; -5.337366e-01 ];
Tc_1r = [ -2.297558e+02 ; -1.820600e+02 ; 3.346794e+03 ];
omc_error_1 = [ 1.051293e-02 ; 1.481943e-02 ; 3.078384e-02 ];
Tc_error_1 = [ 6.178080e+01 ; 5.312910e+01 ; 4.566885e+01 ];
rot1r = rodrigues(omc_1);
camR.R = rodrigues(omc_1);
%-- Image #2:
omc_2 = [ -1.896247e+00 ; -2.052281e+00 ; 8.287345e-01 ];
Tc_2r = [ -3.098787e+02 ; -1.829559e+02 ; 3.185918e+03 ];
omc_error_2 = [ 1.725321e-02 ; 1.215124e-02 ; 2.545286e-02 ];
Tc_error_2 = [ 5.886989e+01 ; 5.083076e+01 ; 3.865880e+01 ];
rot2r = rodrigues(omc_2);

%-- Image #3:
omc_3 = [ 2.078769e+00 ; 2.134766e+00 ; -1.222711e-01 ];
Tc_3r = [ -2.475452e+02 ; -2.287063e+02 ; 3.050238e+03 ];
omc_error_3 = [ 1.301404e-02 ; 1.462338e-02 ; 2.850978e-02 ];
Tc_error_3 = [ 5.621137e+01 ; 4.824592e+01 ; 4.168204e+01 ];
rot3r = rodrigues(omc_3);

%-- Image #4:
omc_4 = [ 1.950706e+00 ; 1.947514e+00 ; 3.950049e-02 ];
Tc_4r = [ -3.747821e+02 ; -2.266995e+02 ; 2.927817e+03 ];
omc_error_4 = [ 1.311921e-02 ; 1.397501e-02 ; 2.079744e-02 ];
Tc_error_4 = [ 5.402174e+01 ; 4.652298e+01 ; 4.061229e+01 ];
rot4r = rodrigues(omc_4);

%-- Image #5:
omc_5 = [ 1.505967e+00 ; 1.768536e+00 ; -9.916514e-01 ];
Tc_5r = [ -1.692792e+02 ; 5.453605e+01 ; 3.342632e+03 ];
omc_error_5 = [ 9.111740e-03 ; 1.751804e-02 ; 1.946190e-02 ];
Tc_error_5 = [ 6.154746e+01 ; 5.315941e+01 ; 4.370740e+01 ];
rot5r = rodrigues(omc_5);

%-- Image #6:
omc_6 = [ 1.346053e+00 ; 2.058495e+00 ; -1.432321e+00 ];
Tc_6r = [ -1.070610e+02 ; 7.122283e+01 ; 3.277358e+03 ];
omc_error_6 = [ 8.288576e-03 ; 1.967770e-02 ; 2.079232e-02 ];
Tc_error_6 = [ 6.035625e+01 ; 5.206333e+01 ; 3.915872e+01 ];
rot6r = rodrigues(omc_6);

%-- Image #7:
omc_7 = [ -1.867988e+00 ; -2.240828e+00 ; 1.041776e+00 ];
Tc_7r = [ -3.357409e+02 ; -1.415234e+02 ; 3.083960e+03 ];
omc_error_7 = [ 1.882891e-02 ; 1.213869e-02 ; 2.444948e-02 ];
Tc_error_7 = [ 5.695097e+01 ; 4.925576e+01 ; 3.766287e+01 ];
rot7r = rodrigues(omc_7);

%-- Image #8:
omc_8 = [ 1.892098e+00 ; 2.229875e+00 ; -7.977637e-01 ];
Tc_8r = [ -1.561014e+02 ; -1.821175e+02 ; 3.143531e+03 ];
omc_error_8 = [ 7.407824e-03 ; 1.616889e-02 ; 2.688724e-02 ];
Tc_error_8 = [ 5.797567e+01 ; 4.981956e+01 ; 4.120427e+01 ];
rot8r = rodrigues(omc_8);
Binary file added Calib_Results_stereo.mat
Binary file not shown.
11 changes: 11 additions & 0 deletions Untitled.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@



[tri,pts] = ply_read('complete-mann.ply','tri')

% For each point in pts, find the closest point in
% your original set of points X
T = delaunayn(X)
nearest = dsearchn(X,T,pts)
%Use color of nearest point
set(h,'FaceVertexCdata',color(nearest,:))
48 changes: 48 additions & 0 deletions cam_calib.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
% TEAPOT
% LEFT CAMERA
%-- Focal length:
fc = [ 1843.463722950638200 ; 1831.060188472588600 ];
camL.f = fc(1);

%-- Principal point:
cc = [ 1457.180947340274300 ; 907.728368229318560 ];
camL.c = cc';

%-- Image #1:
omc_1 = [ 1.879510e+00 ; 1.687184e+00 ; 1.901256e-01 ];
camL.t = [ -8.540793e+02 ; -2.157167e+01 ; 2.936587e+03 ];
% omc_error_1 = [ 2.213462e-02 ; 1.969724e-02 ; 3.010863e-02 ];
% Tc_error_1 = [ 9.032617e+01 ; 8.023056e+01 ; 5.330009e+01 ];
camL.R = rodrigues(omc_1);


% camL.R
%
% ans =
%
% -0.7506 -0.4176 0.5121
% -0.6608 0.4737 -0.5822
% 0.0006 -0.7753 -0.6315
%%
% RIGHT CAMERA
%-- Focal length:
fc = [ 1834.982566594790100 ; 1840.126401445344300 ];
camR.f = fc(1);

%-- Principal point:
cc = [ 1463.788543422015700 ; 991.790475398290940 ];
camR.c = cc';

%-- Image #1:
omc_1 = [ 2.109946e+00 ; 2.179564e+00 ; -5.337366e-01 ];
Tc_1r = [ -2.297558e+02 ; -1.820600e+02 ; 3.346794e+03 ];
omc_error_1 = [ 1.051293e-02 ; 1.481943e-02 ; 3.078384e-02 ];
Tc_error_1 = [ 6.178080e+01 ; 5.312910e+01 ; 4.566885e+01 ];
camR.R = rodrigues(omc_1);
% camR.R
%
% ans =
%
% -0.0605 0.9792 -0.1937
% 0.9579 0.0024 -0.2871
% -0.2806 -0.2029 -0.9381
23 changes: 23 additions & 0 deletions camera_mann.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
%-- Focal length:
camR.f = mean([ 1834.982566594790100 ; 1840.126401445344300 ]);

%-- Principal point:
camR.c = [ 1463.788543422015700 ; 991.790475398290940 ]';

%-- Image #1:
camR.R = rodrigues([ 2.109946e+00 ; 2.179564e+00 ; -5.337366e-01 ]);
camR.t = [ -2.297558e+02 ; -1.820600e+02 ; 3.346794e+03 ];

% LEFT
%-- Focal length:
camL.f = mean([ 1843.463722950638200 ; 1831.060188472588600 ]);

%-- Principal point:
camL.c = [ 1457.180947340274300 ; 907.728368229318560 ]';

%-- Image #1:
camL.R = rodrigues([ 1.879510e+00 ; 1.687184e+00 ; 1.901256e-01 ]);
camL.t = [ -8.540793e+02 ; -2.157167e+01 ; 2.936587e+03 ];

camL.t = zeros(3,1);
camL.R = eye(3);
46 changes: 46 additions & 0 deletions camera_mann_stereo.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
% Stereo calibration parameters after loading the individual calibration files:
% MANNEQUIN

% Intrinsic parameters of left camera:

%
fc_left = [ 1843.46296 1831.05933 ];
% ± [ 33.34960 29.52549 ]
%
cc_left = [ 1457.18240 907.72981 ];
% ± [ 55.83387 48.79968 ]
%Skew:
alpha_c_left = [ 0.00000 ] ;
% ± [ 0.00000 ] => angle of pixel axes = 90.00000 ± 0.00000 degrees
%Distortion:
kc_left = [ -0.06766 0.04253 0.00487 0.01396 0.00000 ];
% ± [ 0.09025 0.41110 0.00751 0.01018 0.00000 ]
camL.f = mean([ 1843.463722950638200 ; 1831.060188472588600 ]);
camL.c = [ 1457.180947340274300 ; 907.728368229318560 ]';
%Intrinsic parameters of right camera:

%Focal Length:
fc_right = [ 1834.98258 1840.12641 ] ;
% ± [ 25.59413 21.45949 ]
%Principal point:
cc_right = [ 1463.78849 991.79014 ];
% ± [ 33.84495 29.26491 ]
%Skew:
alpha_c_right = [ 0.00000 ];
% ± [ 0.00000 ]
% => angle of pixel axes = 90.00000 ± 0.00000 degrees
%Distortion:
kc_right = [ -0.07478 -0.52281 0.01469 0.02332 0.00000 ] ;
% ± [ 0.08773 1.07657 0.00471 0.00545 0.00000 ]
camR.f = mean([ 1834.982566594790100 ; 1840.126401445344300 ]);
camR.c = [ 1463.788543422015700 ; 991.790475398290940 ]';
%Extrinsic parameters (position of right camera wrt left camera):

%Rotation vector:
om = [ 0.03876 0.74250 0.02364 ];
camR.R = rodrigues(om);
%Translation vector:
T = [ -476.62914 -15.05662 182.24336 ]';
camR.t = T';
camL.R = eye(3);
camL.t = zeros(3,1);
16 changes: 16 additions & 0 deletions color_mesh.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
% color the mesh
[tri, pts] = ply_read('mann1.ply','tri');
T = delaunayn(Xold);
nearest = dsearchn(X,T,pts);

h = trisurf(tri,Y(1,:),Y(2,:),Y(3,:));
set(h,'edgecolor','flat')
axis image; axis vis3d;

camorbit(120,0); camlight left;
camorbit(120,0); camlight left;
lighting flat;
set(gca,'projection','perspective')
set(gcf,'renderer','opengl')
set(h,'facevertexcdata',xColor'/255);
material dull
Loading

0 comments on commit cf92f4f

Please sign in to comment.