diff options
| author | leochanj105 <leochanj@live.unc.edu> | 2020-10-19 23:09:30 -0400 |
|---|---|---|
| committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-20 02:40:39 -0400 |
| commit | f618466c25d43f3bae9e40920273bf77de1e1149 (patch) | |
| tree | 460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib | |
| parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff) | |
initial sd-vbs
initial sd-vbs
add sd-vbs
sd-vbs
Diffstat (limited to 'SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib')
74 files changed, 8209 insertions, 0 deletions
diff --git a/SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib/Distor2Calib.m b/SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib/Distor2Calib.m new file mode 100755 index 0000000..a82f583 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/TOOLBOX_calib/Distor2Calib.m | |||
| @@ -0,0 +1,391 @@ | |||
| 1 | function [fc_2,Rc_2,Tc_2,H_2,distance,V_vert,V_hori,x_all_c,V_hori_pix,V_vert_pix,V_diag1_pix,V_diag2_pix]=Distor2Calib(k_dist,grid_pts_centered,n_sq_x,n_sq_y,Np,W,L,Xgrid_2,f_ini,N_iter,two_focal); | ||
| 2 | |||
| 3 | % Computes the calibration parameters knowing the | ||
| 4 | % distortion factor k_dist | ||
| 5 | |||
| 6 | % grid_pts_centered are the grid point coordinates after substraction of | ||
| 7 | % the optical center. | ||
| 8 | |||
| 9 | % can give an optional guess for the focal length f_ini (can set to []) | ||
| 10 | % can provide the number of iterations for the Iterative Vanishing Point Algorithm | ||
| 11 | |||
| 12 | % if the focal length is known perfectly, then, there is no need to iterate, | ||
| 13 | % and therefore, one can fix: N_iter = 0; | ||
| 14 | |||
| 15 | % California Institute of Technology | ||
| 16 | % (c) Jean-Yves Bouguet - October 7th, 1997 | ||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | %keyboard; | ||
| 21 | |||
| 22 | if exist('two_focal'), | ||
| 23 | if isempty(two_focal), | ||
| 24 | two_focal=0; | ||
| 25 | end; | ||
| 26 | else | ||
| 27 | two_focal = 0; | ||
| 28 | end; | ||
| 29 | |||
| 30 | |||
| 31 | if exist('N_iter'), | ||
| 32 | if ~isempty(N_iter), | ||
| 33 | disp('Use number of iterations provided'); | ||
| 34 | else | ||
| 35 | N_iter = 10; | ||
| 36 | end; | ||
| 37 | else | ||
| 38 | N_iter = 10; | ||
| 39 | end; | ||
| 40 | |||
| 41 | if exist('f_ini'), | ||
| 42 | if ~isempty(f_ini), | ||
| 43 | disp('Use focal provided'); | ||
| 44 | if length(f_ini)<2, f_ini=[f_ini;f_ini]; end; | ||
| 45 | fc_2 = f_ini; | ||
| 46 | x_all_c = [grid_pts_centered(1,:)/fc_2(1);grid_pts_centered(2,:)/fc_2(2)]; | ||
| 47 | x_all_c = comp_distortion(x_all_c,k_dist); % we can this time!!! | ||
| 48 | else | ||
| 49 | fc_2 = [1;1]; | ||
| 50 | x_all_c = grid_pts_centered; | ||
| 51 | end; | ||
| 52 | else | ||
| 53 | fc_2 = [1;1]; | ||
| 54 | x_all_c = grid_pts_centered; | ||
| 55 | end; | ||
| 56 | |||
