Changeset 242


Ignore:
Timestamp:
Apr 19, 2011, 10:24:16 AM (13 years ago)
Author:
sommeria
Message:

phys_XYZ introduced as a main function, geometry_calib corrected to deal with reverse x axis in mode linear

Location:
trunk/src
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/geometry_calib.m

    r238 r242  
    441441%------------------------------------------------------------------------
    442442% determine the parameters for a calibration by a linear transform matrix (rescale and rotation)
     443
     444
    443445function GeometryCalib=calib_linear(Coord,handles)
    444446%------------------------------------------------------------------------
     
    456458% R=[a_X1(2),a_X1(3),0;a_Y1(2),a_Y1(3),0;0,0,1];
    457459R=[a_X1(2),a_X1(3);a_Y1(2),a_Y1(3)];
     460epsilon=sign(det(R));
    458461norm=abs(det(R));
    459462GeometryCalib.CalibrationType='linear';
    460463if (a_X1(2)/a_Y1(3))>0
    461     epsilon=1;
    462 GeometryCalib.fx_fy(1)=sqrt((a_X1(2)/a_Y1(3))*norm);
     464    GeometryCalib.fx_fy(1)=sqrt((a_X1(2)/a_Y1(3))*norm);
    463465else
    464     GeometryCalib.fx_fy(1)=-sqrt((-a_X1(2)/a_Y1(3))*norm);
    465       epsilon=-1;
     466    GeometryCalib.fx_fy(1)=-sqrt(-(a_X1(2)/a_Y1(3))*norm);
    466467end
    467468GeometryCalib.fx_fy(2)=(a_Y1(3)/a_X1(2))*GeometryCalib.fx_fy(1);
     
    469470%GeometryCalib.Tx_Ty_Tz=[a_X1(1) a_Y1(1) 1];
    470471GeometryCalib.Tx_Ty_Tz=[a_X1(1)/GeometryCalib.fx_fy(1) a_Y1(1)/GeometryCalib.fx_fy(2) 1];
    471 R(1,:)=epsilon*R(1,:)/GeometryCalib.fx_fy(1);
     472R(1,:)=R(1,:)/GeometryCalib.fx_fy(1);
    472473R(2,:)=R(2,:)/GeometryCalib.fx_fy(2);
    473474R=[R;[0 0]];
    474 GeometryCalib.R=[R [0;0;-1]];
    475 GeometryCalib.omc=(180/pi)*[acos(GeometryCalib.R(1,1)) 0 0]
     475GeometryCalib.R=[R [0;0;-epsilon]];
     476GeometryCalib.omc=(180/pi)*[acos(GeometryCalib.R(1,1)) 0 0];
    476477%------------------------------------------------------------------------
    477478% determine the tsai parameters for a view normal to the grid plane
  • trunk/src/uvmat.m

    r238 r242  
    43084308function list_object_2_Callback(hObject, eventdata, handles)
    43094309%------------------------------------------------------------------------
    4310 list_str=get(handles.list_object_2,'String')
    4311 IndexObj=get(handles.list_object_2,'Value')
     4310list_str=get(handles.list_object_2,'String');
     4311IndexObj=get(handles.list_object_2,'Value');
    43124312if ischar(list_str) || isempty(list_str{IndexObj})% || strcmp(list_str{IndexObj},'...')
    43134313    hview_field=findobj(allchild(0),'Tag','view_field');
Note: See TracChangeset for help on using the changeset viewer.