Changeset 999 for trunk/src/toolbox_calib
- Timestamp:
- Feb 17, 2017, 12:17:59 PM (8 years ago)
- Location:
- trunk/src/toolbox_calib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/toolbox_calib/init_intrinsic_param.m
r926 r999 9 9 %OUTPUT: fc: Camera focal length 10 10 % cc: Principal point coordinates 11 % 11 % kc: Distortion coefficients 12 12 % alpha_c: skew coefficient 13 13 % KK: The camera matrix (containing fc, cc and alpha_c) … … 89 89 90 90 for kk=1:n_ima, 91 91 92 92 if active_images(kk), 93 93 94 94 eval(['Hkk = H_' num2str(kk) ';']); 95 96 Hkk = Sub_cc * Hkk; 97 95 96 Hkk = Sub_cc * Hkk; 97 98 98 % Extract vanishing points (direct and diagonals): 99 99 100 100 V_hori_pix = Hkk(:,1); 101 101 V_vert_pix = Hkk(:,2); 102 102 V_diag1_pix = (Hkk(:,1)+Hkk(:,2))/2; 103 103 V_diag2_pix = (Hkk(:,1)-Hkk(:,2))/2; 104 104 105 105 V_hori_pix = V_hori_pix/norm(V_hori_pix); 106 106 V_vert_pix = V_vert_pix/norm(V_vert_pix); 107 107 V_diag1_pix = V_diag1_pix/norm(V_diag1_pix); 108 108 V_diag2_pix = V_diag2_pix/norm(V_diag2_pix); 109 109 110 110 a1 = V_hori_pix(1); 111 111 b1 = V_hori_pix(2); 112 112 c1 = V_hori_pix(3); 113 113 114 114 a2 = V_vert_pix(1); 115 115 b2 = V_vert_pix(2); 116 116 c2 = V_vert_pix(3); 117 117 118 118 a3 = V_diag1_pix(1); 119 119 b3 = V_diag1_pix(2); 120 120 c3 = V_diag1_pix(3); 121 121 122 122 a4 = V_diag2_pix(1); 123 123 b4 = V_diag2_pix(2); 124 124 c4 = V_diag2_pix(3); 125 125 126 126 A_kk = [a1*a2 b1*b2; 127 127 a3*a4 b3*b4]; 128 128 129 129 b_kk = -[c1*c2;c3*c4]; 130 131 130 131 132 132 A = [A;A_kk]; 133 133 b = [b;b_kk]; 134 134 135 135 end; 136 136 137 137 end; 138 138 … … 148 148 end; 149 149 150 150 151 151 152 152 if two_focals_init … … 185 185 fprintf(1,'Principal point: cc = [ %3.5f %3.5f ]\n',cc); 186 186 fprintf(1,'Skew: alpha_c = [ %3.5f ] => angle of pixel = %3.5f degrees\n',alpha_c,90 - atan(alpha_c)*180/pi); 187 fprintf(1,'Distortion: kc = [ %3.5f %3.5f %3.5f %3.5f %5.5f ]\n',kc); 187 fprintf(1,'Distortion: kc = [ %3.5f %3.5f %3.5f %3.5f %5.5f ]\n',kc); -
trunk/src/toolbox_calib/normalize_pixel.m
r926 r999 41 41 42 42 if norm(kc) ~= 0, 43 44 43 % Third: Compensate for lens distortion: 44 xn = comp_distortion_oulu(x_distort,kc); 45 45 else 46 46 xn = x_distort;
Note: See TracChangeset
for help on using the changeset viewer.