Changeset 1111 for trunk/src/geometry_calib.m
- Timestamp:
- Jan 26, 2022, 9:31:42 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r1107 r1111 255 255 ['Error max (along x,y)=' num2str(GeometryCalib.ErrorMax) ' pixels']; 256 256 [num2str(numel(ind_removed)) ' points removed']}); 257 SliceCoord_ref=[0 0 0]; %default reference plane257 % SliceCoord_ref=[0 0 0]; %default reference plane 258 258 if strcmp(answer,'Yes') %store the calibration data 259 if strcmp(calib_cell{val}(1:2),'3D')%set the plane position for 3D (projection) calibration 260 answer=msgbox_uvmat('INPUT_Y-N',{['Assume that the current image is in the plane of the calib points z=' num2str(Z_plane) ] ; 'can be later modified by MenuSetSlice in the upper bar menu of uvmat'}); 261 SliceCoord_ref=Z_plane'*[0 0 1]; 259 Z=Coord(:,3); 260 if strcmp(calib_cell{val}(1:2),'3D') && isequal(max(Z),min(Z))%set the plane position for 3D (projection) calibration 261 %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 if strcmp(answer,'Yes') 264 GeometryCalib.NbSlice=1; 265 GeometryCalib.SliceCoord=[0 0 Z(1)]; 266 end 262 267 end 263 268 else … … 390 395 ind_max=[];ind_removed=[];Z_plane=[]; 391 396 % apply the calibration, whose type is selected in handles.calib_type 397 CoordFlip=Coord; 398 CoordFlip(:,3)=-Coord(:,3); 392 399 if ~isempty(Coord) 393 GeometryCalib=feval(CalibFcn,Coord ,Intrinsic);400 GeometryCalib=feval(CalibFcn,CoordFlip,Intrinsic); 394 401 else 395 402 msgbox_uvmat('ERROR','No calibration points, abort') … … 401 408 402 409 % estimate calibration error rms and max 403 X=Coord(:,1);404 Y=Coord(:,2);410 % X=Coord(:,1); 411 % Y=Coord(:,2); 405 412 Z=Coord(:,3); 406 413 x_ima=Coord(:,4); 407 414 y_ima=Coord(:,5); 408 [Xpoints,Ypoints]=px_XYZ(GeometryCalib, X,Y,Z);415 [Xpoints,Ypoints]=px_XYZ(GeometryCalib,Coord(:,1),Coord(:,2),Coord(:,3));% convention of downward z coordinate (facing the camera) 409 416 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); 410 417 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima))); … … 434 441 end 435 442 GeometryCalib.ErrorMax=ErrorMax; 436 % set the Z position of the reference plane used for calibration437 if isequal(max(Z),min(Z))%Z constant438 Z_plane=Z(1);439 GeometryCalib.NbSlice=1;440 GeometryCalib.SliceCoord=[0 0 Z_plane];441 end443 % %set the Z position of the reference plane used for calibration 444 % if isequal(max(Z),min(Z))%Z constant 445 % Z_plane=Z(1); 446 % GeometryCalib.NbSlice=1; 447 % GeometryCalib.SliceCoord=[0 0 Z_plane]; 448 % end 442 449 443 450
Note: See TracChangeset
for help on using the changeset viewer.