- Timestamp:
- Mar 25, 2010, 7:12:53 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/geometry_calib.m
r67 r69 43 43 % Edit the above text to modify the response to help geometry_calib 44 44 45 % Last Modified by GUIDE v2.5 2 3-Mar-2010 16:19:0145 % Last Modified by GUIDE v2.5 25-Mar-2010 19:10:05 46 46 47 47 % Begin initialization code - DO NOT edit … … 255 255 elseif isequal(calib_type,'linear') 256 256 GeometryCalib=calib_linear(Object.Coord); 257 elseif isequal(calib_type,'tsai ')257 elseif isequal(calib_type,'tsai_cpp') 258 258 GeometryCalib=calib_tsai(Object.Coord); 259 elseif isequal(calib_type,'tsai_matlab') 260 GeometryCalib=calib_tsai2(Object.Coord); 259 261 end 260 262 unitlist=get(handles.CoordUnit,'String'); … … 297 299 uvmat('RootPath_Callback',hObject,eventdata,hhuvmat); %file input with xml reading in uvmat 298 300 299 %------------------------------------------------------------------------ 301 figure(handles.geometry_calib) 302 303 %------------------------------------------------------------------ 300 304 % --- Executes on button press in calibrate_lin. 301 305 function REPLICATE_Callback(hObject, eventdata, handles) … … 434 438 435 439 %------------------------------------------------------------------------ 440 function GeometryCalib=calib_tsai2(Coord) 441 %------------------------------------------------------------------ 442 path_uvmat=which('uvmat');% check the path detected for source file uvmat 443 path_UVMAT=fileparts(path_uvmat); %path to UVMAT 444 445 x_1=Coord(:,4:5)'; 446 X_1=Coord(:,1:3)'; 447 n_ima=1; 448 % check_cond=0; 449 nx=1024;ny=1024; 450 % est_kc=[1;0;0;0;0]; 451 est_dist=[1;0;0;0;0]; 452 run('D:\PROG\MATLAB\TOOLBOX_calib\go_calib_optim'); 453 454 GeometryCalib.CalibrationType='tsai'; 455 GeometryCalib.focal=f(2); 456 GeometryCalib.dpx_dpy=[1 1]; 457 GeometryCalib.Cx_Cy=cc'; 458 GeometryCalib.sx=fc(1)/fc(2); 459 GeometryCalib.kappa1=-k(1)/f(2)^2; 460 GeometryCalib.CoordUnit=[];% default value, to be updated by the calling function 461 GeometryCalib.Tx_Ty_Tz=Tc_1'; 462 GeometryCalib.R=Rc_1; 463 Calib.dpx=GeometryCalib.dpx_dpy(1); 464 Calib.dpy=GeometryCalib.dpx_dpy(2); 465 Calib.sx=GeometryCalib.sx; 466 Calib.Cx=GeometryCalib.Cx_Cy(1); 467 Calib.Cy=GeometryCalib.Cx_Cy(2); 468 Calib.kappa1=GeometryCalib.kappa1; 469 Calib.f=GeometryCalib.focal; 470 Calib.Tx=GeometryCalib.Tx_Ty_Tz(1); 471 Calib.Ty=GeometryCalib.Tx_Ty_Tz(2); 472 Calib.Tz=GeometryCalib.Tx_Ty_Tz(3); 473 Calib.R=GeometryCalib.R; 474 X=Coord(:,1); 475 Y=Coord(:,2); 476 Z=Coord(:,3); 477 x_ima=Coord(:,4); 478 y_ima=Coord(:,5); 479 [Xpoints,Ypoints]=px_XYZ(Calib,X,Y,Z); 480 481 GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima))); 482 GeometryCalib.ErrorMax(1)=max(abs(Xpoints-x_ima)); 483 GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima))); 484 GeometryCalib.ErrorMax(2)=max(abs(Ypoints-y_ima)); 485 436 486 function GeometryCalib=calib_tsai(Coord) 437 487 %------------------------------------------------------------------------ … … 922 972 set(handles.ListCoord,'Value',1) 923 973 set(handles.ListCoord,'String',Tabchar) 924 925 926 974 % -------------------------------------------------------------------- 927 975 function MenuDetectGrid_Callback(hObject, eventdata, handles)
Note: See TracChangeset
for help on using the changeset viewer.