Changeset 840 for trunk/src/series/civ2vel_3C.m
- Timestamp:
- Dec 10, 2014, 11:11:09 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/series/civ2vel_3C.m
r839 r840 127 127 [filecell,i1_series,i2_series,j1_series,j2_series]=get_file_series(Param); 128 128 129 %% grid of physical positions 130 [x,y]=meshgrid(ObjectData.RangeX(1):ObjectData.DX:ObjectData.RangeX(2),ObjectData.RangeY(1):ObjectData.DY:ObjectData.RangeY(2)); 131 %camera coordinates:initialisation 2 cameras 132 NbCamera=2; 133 X=zeros(NbCamera,size(x,1),size(y,1)); 134 Y=zeros(NbCamera,size(x,1),size(y,1)); 135 for icamera=1:NbCamera 136 %camera coordinates 137 Calib=XmlData{1}.GeometryCalib; 138 xc=R(1)*Xphys+R(2)*Yphys+R(3)*Zphys+Calib.Tx_Ty_Tz(1); 139 yc=R(4)*Xphys+R(5)*Yphys+R(6)*Zphys+Calib.Tx_Ty_Tz(2); 140 zc=R(7)*Xphys+R(8)*Yphys+R(9)*Zphys+Calib.Tx_Ty_Tz(3); 141 142 %undistorted image coordinates 143 X(icamera,:,:)=xc./zc; 144 Y(icamera,:,:)=yc./zc; 145 end 146 147 %% case of fixed planes (for moving interface, coeff need to be calculated for each field 148 if isequal(size(InputTable),2) 149 [S,D]=get_coeff(XmlData,X,Y); 150 end 151 129 152 %% MAIN LOOP ON FIELDS 130 153 for index=1:NbField … … 154 177 155 178 %% transform the input field (e.g; phys) if requested (no transform involving two input fields) 179 %camera coordinates 180 xc=R(1)*Xphys+R(2)*Yphys+R(3)*Zphys+Calib.Tx_Ty_Tz(1); 181 yc=R(4)*Xphys+R(5)*Yphys+R(6)*Zphys+Calib.Tx_Ty_Tz(2); 182 zc=R(7)*Xphys+R(8)*Yphys+R(9)*Zphys+Calib.Tx_Ty_Tz(3); 183 184 %undistorted image coordinates 185 Xu=xc./zc; 186 Yu=yc./zc; 156 187 Data{iview}=phys(Data{iview},XmlData{iview}); 157 188 … … 346 377 display([file_st ' written']) 347 378 348 379 function [S,D]=get_coeff(XmlData,X,Y); 380 Calib_a=XmlData{1}.GeometryCalib; 381 R=(Calib_a.R)';%rotation matrix 382 A(1,1)=R(1)-R(7)*X; 383 A(1,2)=R(2)-R(8)*X; 384 A(1,3)=R(3)-R(9)*X; 385 A(2,1)=R(4)-R(7)*Y; 386 A(2,2)=R(5)-R(8)*Y; 387 A(2,3)=R(6)-R(9)*Y; 349 388 350 389 %'pxcm_tsai': find differentials of the Tsai calibration
Note: See TracChangeset
for help on using the changeset viewer.