Changeset 38 for trunk/src/RUN_STLIN.m
- Timestamp:
- Mar 7, 2010, 6:30:11 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/RUN_STLIN.m
r19 r38 26 26 end 27 27 if isempty(npxA) ||isempty(npxB) 28 warndlg_uvmat('The size of image A needs to be defined in the xml file ImaDoc','ERROR')28 msgbox_uvmat('ERROR','The size of image A needs to be defined in the xml file ImaDoc') 29 29 return 30 30 elseif isempty(npxB) || isempty(npyB) 31 warndlg_uvmat('The size of image B needs to be defined in the xml file ImaDoc','ERROR')31 msgbox_uvmat('ERROR','The size of image B needs to be defined in the xml file ImaDoc') 32 32 return 33 33 end … … 35 35 tsaiA=XmlDataA.GeometryCalib; 36 36 else 37 warndlg_uvmat('no geometric calibration available for image A','ERROR')37 msgbox_uvmat('ERROR','no geometric calibration available for image A') 38 38 return 39 39 end … … 41 41 tsaiB=XmlDataB.GeometryCalib; 42 42 else 43 warndlg_uvmat('no geometric calibration available for image B','ERROR')43 msgbox_uvmat('ERROR','no geometric calibration available for image B') 44 44 return 45 45 end … … 98 98 [Field,VelTypeOut]=read_civxdata(file_B,FieldNames,vel_type); 99 99 if ~isequal(Field.dt,dt) 100 warndlg_uvmat('different time intervals for the two velocity fields ','ERROR')100 msgbox_uvmat('ERROR','different time intervals for the two velocity fields ') 101 101 return 102 102 end 103 103 if ~isequal(Field.Time,time) 104 warndlg_uvmat('different times for the two velocity fields ','ERROR')104 msgbox_uvmat('ERROR','different times for the two velocity fields ') 105 105 return 106 106 end … … 191 191 192 192 193 194 195 196 197 198 199 200 201 202 193 %'pxcm_tsai': find differentials of the Tsai calibration 194 % 195 function [A11,A12,A13,A21,A22,A23]=pxcm_tsai(a,var_phys) 196 a_read=a; 197 198 R=(a.R)'; 199 200 x=var_phys(:,1); 201 y=var_phys(:,2); 202 203 if isfield(a,'PlanePos') 204 prompt={'Plane 1 Index','Plane 2 Index'}; 205 Rep=inputdlg(prompt,'Target displacement test'); 206 Z1=str2double(Rep(1)); 207 Z2=str2double(Rep(2)); 208 z=(a.PlanePos(Z2,3)+a.PlanePos(Z1,3))/2 209 else 210 z=0; 211 end 212 213 %transform coeff for differentiels 214 a.C11=R(1)*R(8)-R(2)*R(7); 215 a.C12=R(2)*R(7)-R(1)*R(8); 216 a.C21=R(4)*R(8)-R(5)*R(7); 217 a.C22=R(5)*R(7)-R(4)*R(8); 218 a.C1x=R(3)*R(7)-R(9)*R(1); 219 a.C1y=R(3)*R(8)-R(9)*R(2); 220 a.C2x=R(6)*R(7)-R(9)*R(4); 221 a.C2y=R(6)*R(8)-R(9)*R(5); 222 223 224 %dependence in x,y 225 denom=(R(7)*x+R(8)*y+R(9)*z+a.Tz).*(R(7)*x+R(8)*y+R(9)*z+a.Tz); 226 A11=(a.f*a.sx*(a.C11*y-a.C1x*z+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx; 227 A12=(a.f*a.sx*(a.C12*x-a.C1y*z+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx; 228 A21=(a.f*a.sx*(a.C21*y-a.C2x*z+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy; 229 A22=(a.f*(a.C22*x-a.C2y*z+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy; 230 A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx; 231 A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy; 232 233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 234 %Old Version for z=0 235 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 236 % %'camera' coordinates 237 % xc=R(1)*x+R(2)*y+a.Tx; 238 % yc=R(4)*x+R(5)*y+a.Ty; 239 % zc=R(7)*x+R(8)*y+a.Tz; 240 % %undistorted image coordinates 241 % Xu=a.f*xc./zc; 242 % Yu=a.f*yc./zc; 243 % %distorted image coordinates 244 % distortion=(a.kappa1)*(Xu.*Xu+Yu.*Yu)+1; %!! intégrer derivation kappa 245 % % distortion=1; 246 % Xd=Xu./distortion; 247 % Yd=Yu./distortion; 248 % %pixel coordinates 249 % X=Xd*a.sx/a.dpx+a.Cx; 250 % Y=Yd/a.dpy+a.Cy; 251 % 252 % %transform coeff for differentiels 253 % a.C11=R(1)*R(8)-R(2)*R(7); 254 % a.C12=R(2)*R(7)-R(1)*R(8); 255 % a.C21=R(4)*R(8)-R(5)*R(7); 256 % a.C22=R(5)*R(7)-R(4)*R(8); 257 % a.C1x=R(3)*R(7)-R(9)*R(1); 258 % a.C1y=R(3)*R(8)-R(9)*R(2); 259 % a.C2x=R(6)*R(7)-R(9)*R(4); 260 % a.C2y=R(6)*R(8)-R(9)*R(5); 261 % 262 % 263 % %dependence in x,y 264 % denom=(R(7)*x+R(8)*y+a.Tz).*(R(7)*x+R(8)*y+a.Tz); 265 % A11=(a.f*a.sx*(a.C11*y+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx; 266 % A12=(a.f*a.sx*(a.C12*x+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx; 267 % A21=(a.f*a.sx*(a.C21*y+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy; 268 % A22=(a.f*(a.C22*x+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy; 269 % A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx; 270 % A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy; 271 % 272 273 274 275 276 277 278 279 280 281
Note: See TracChangeset
for help on using the changeset viewer.