Changeset 69 for trunk/src


Ignore:
Timestamp:
Mar 25, 2010, 7:12:53 PM (15 years ago)
Author:
gostiaux
Message:

Matlab tsai calibration included

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r67 r69  
    4343% Edit the above text to modify the response to help geometry_calib
    4444
    45 % Last Modified by GUIDE v2.5 23-Mar-2010 16:19:01
     45% Last Modified by GUIDE v2.5 25-Mar-2010 19:10:05
    4646
    4747% Begin initialization code - DO NOT edit
     
    255255elseif isequal(calib_type,'linear')
    256256    GeometryCalib=calib_linear(Object.Coord);
    257 elseif isequal(calib_type,'tsai')
     257elseif isequal(calib_type,'tsai_cpp')
    258258    GeometryCalib=calib_tsai(Object.Coord);
     259elseif isequal(calib_type,'tsai_matlab')
     260    GeometryCalib=calib_tsai2(Object.Coord);
    259261end
    260262unitlist=get(handles.CoordUnit,'String');
     
    297299uvmat('RootPath_Callback',hObject,eventdata,hhuvmat); %file input with xml reading  in uvmat
    298300
    299 %------------------------------------------------------------------------
     301figure(handles.geometry_calib)
     302
     303%------------------------------------------------------------------
    300304% --- Executes on button press in calibrate_lin.
    301305function REPLICATE_Callback(hObject, eventdata, handles)
     
    434438
    435439%------------------------------------------------------------------------
     440function GeometryCalib=calib_tsai2(Coord)
     441%------------------------------------------------------------------
     442path_uvmat=which('uvmat');% check the path detected for source file uvmat
     443path_UVMAT=fileparts(path_uvmat); %path to UVMAT
     444
     445x_1=Coord(:,4:5)';
     446X_1=Coord(:,1:3)';
     447n_ima=1;
     448% check_cond=0;
     449nx=1024;ny=1024;
     450% est_kc=[1;0;0;0;0];
     451est_dist=[1;0;0;0;0];
     452run('D:\PROG\MATLAB\TOOLBOX_calib\go_calib_optim');
     453
     454GeometryCalib.CalibrationType='tsai';
     455GeometryCalib.focal=f(2);
     456GeometryCalib.dpx_dpy=[1 1];
     457GeometryCalib.Cx_Cy=cc';
     458GeometryCalib.sx=fc(1)/fc(2);
     459GeometryCalib.kappa1=-k(1)/f(2)^2;
     460GeometryCalib.CoordUnit=[];% default value, to be updated by the calling function
     461GeometryCalib.Tx_Ty_Tz=Tc_1';
     462GeometryCalib.R=Rc_1;
     463Calib.dpx=GeometryCalib.dpx_dpy(1);
     464Calib.dpy=GeometryCalib.dpx_dpy(2);
     465Calib.sx=GeometryCalib.sx;
     466Calib.Cx=GeometryCalib.Cx_Cy(1);
     467Calib.Cy=GeometryCalib.Cx_Cy(2);
     468Calib.kappa1=GeometryCalib.kappa1;
     469Calib.f=GeometryCalib.focal;
     470Calib.Tx=GeometryCalib.Tx_Ty_Tz(1);
     471Calib.Ty=GeometryCalib.Tx_Ty_Tz(2);
     472Calib.Tz=GeometryCalib.Tx_Ty_Tz(3);
     473Calib.R=GeometryCalib.R;
     474X=Coord(:,1);
     475Y=Coord(:,2);
     476Z=Coord(:,3);
     477x_ima=Coord(:,4);
     478y_ima=Coord(:,5);
     479[Xpoints,Ypoints]=px_XYZ(Calib,X,Y,Z);
     480
     481GeometryCalib.ErrorRms(1)=sqrt(mean((Xpoints-x_ima).*(Xpoints-x_ima)));
     482GeometryCalib.ErrorMax(1)=max(abs(Xpoints-x_ima));
     483GeometryCalib.ErrorRms(2)=sqrt(mean((Ypoints-y_ima).*(Ypoints-y_ima)));
     484GeometryCalib.ErrorMax(2)=max(abs(Ypoints-y_ima));
     485
    436486function GeometryCalib=calib_tsai(Coord)
    437487%------------------------------------------------------------------------
     
    922972set(handles.ListCoord,'Value',1)
    923973set(handles.ListCoord,'String',Tabchar)
    924 
    925 
    926974% --------------------------------------------------------------------
    927975function MenuDetectGrid_Callback(hObject, eventdata, handles)
Note: See TracChangeset for help on using the changeset viewer.