Changeset 1112 for trunk/src/geometry_calib.m
- Timestamp:
- Jan 26, 2022, 7:37:21 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r1111 r1112 256 256 [num2str(numel(ind_removed)) ' points removed']}); 257 257 % SliceCoord_ref=[0 0 0]; %default reference plane 258 checkslice=0; 258 259 if strcmp(answer,'Yes') %store the calibration data 259 260 Z=Coord(:,3); 260 261 if strcmp(calib_cell{val}(1:2),'3D') && isequal(max(Z),min(Z))%set the plane position for 3D (projection) calibration 261 262 %set the Z position of the reference plane used for calibration 262 answer=msgbox_uvmat('INPUT_Y-N',{[' Assume that the illuminated plane is at z=' num2str(Z(1))] ; 'can be later modified by MenuSetSlice in the upper bar menu of uvmat'});263 answer=msgbox_uvmat('INPUT_Y-N',{['Do you assume that the illuminated plane is at z=' num2str(Z(1)) '?' ] ; 'can be later modified by MenuSetSlice in the upper bar menu of uvmat'}); 263 264 if strcmp(answer,'Yes') 264 GeometryCalib.NbSlice=1; 265 GeometryCalib.SliceCoord=[0 0 Z(1)]; 265 Slice.NbSlice=1; 266 Slice.SliceCoord=[0 0 Z(1)]; 267 checkslice=1;% will document the item <Slice> in ImaDoc 266 268 end 267 269 end … … 319 321 end 320 322 errormsg=update_imadoc(GeometryCalib,XmlName,'GeometryCalib');% introduce the calibration data in the xml file 323 dispmessage=''; 324 if checkslice 325 errormsg=update_imadoc(Slice,XmlName,'Slice');% introduce the slice position in the xml file 326 dispmessage=' and slice position'; 327 end 321 328 if ~strcmp(errormsg,'') 322 329 msgbox_uvmat('ERROR',errormsg); 323 330 else 324 331 if check_update 325 display([XmlName ' updated with calibration parameters' ])332 display([XmlName ' updated with calibration parameters' dispmessage]) 326 333 else 327 display([XmlName ' created with calibration parameters' ])334 display([XmlName ' created with calibration parameters' dispmessage]) 328 335 end 329 %nbcalib=nbcalib+1;330 336 end 331 337 end … … 333 339 msgbox_uvmat('CONFIMATION',['calibration replicated for ' num2str(NbExp) ' experiments']); 334 340 else 335 %% copy the xml file from the old location if appropriate, then update with the calibration parameters336 if ~exist(outputfile,'file') && ~isempty(SubDirBase) 341 %% update the calibration parameters in the currently opened uvmat GUI 342 if ~exist(outputfile,'file') && ~isempty(SubDirBase) %copy the xml file from the old location if appropriate 337 343 oldxml=[fullfile(RootPath,SubDirBase,get(hhuvmat.RootFile,'String')) '.xml']; 338 344 if exist(oldxml,'file') … … 341 347 end 342 348 errormsg=update_imadoc(GeometryCalib,outputfile,'GeometryCalib');% introduce the calibration data in the xml file 349 if checkslice 350 errormsg=update_imadoc(Slice,outputfile,'Slice');% introduce the slice position in the xml file 351 end 343 352 if ~strcmp(errormsg,'') 344 353 msgbox_uvmat('ERROR',errormsg); 345 354 end 346 355 347 %% display image with new calibration in the currently opened uvmat interface356 %% display image with new calibration in the currently opened uvmat GUI 348 357 FieldList=get(hhuvmat.FieldName,'String'); 349 358 val=get(hhuvmat.FieldName,'Value'); … … 413 422 x_ima=Coord(:,4); 414 423 y_ima=Coord(:,5); 415 [Xpoints,Ypoints]=px_XYZ(GeometryCalib, Coord(:,1),Coord(:,2),Coord(:,3));% convention of downward z coordinate (facing the camera)424 [Xpoints,Ypoints]=px_XYZ(GeometryCalib,[],Coord(:,1),Coord(:,2),Coord(:,3));% convention of downward z coordinate (facing the camera) 416 425 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); 417 426 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima))); … … 436 445 x_ima=Coord(:,4); 437 446 y_ima=Coord(:,5); 438 [Xpoints,Ypoints]=px_XYZ(GeometryCalib, X,Y,Z);447 [Xpoints,Ypoints]=px_XYZ(GeometryCalib,[],X,Y,Z); 439 448 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); 440 449 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima))); … … 805 814 x_ima=Coord(:,4); 806 815 y_ima=Coord(:,5); 807 [Xpoints,Ypoints]=px_XYZ(Calib, X,Y,Z);816 [Xpoints,Ypoints]=px_XYZ(Calib,[],X,Y,Z); 808 817 ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); 809 818 ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
Note: See TracChangeset
for help on using the changeset viewer.