Changeset 38 for trunk/src/RUN_STLIN.m


Ignore:
Timestamp:
Mar 7, 2010, 6:30:11 PM (11 years ago)
Author:
sommeria
Message:

field transforms put in subdir transform_field. cleaning of obsolete functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/RUN_STLIN.m

    r19 r38  
    2626 end
    2727 if isempty(npxA) ||isempty(npxB)
    28      warndlg_uvmat('The size of image A needs to be defined in the xml file ImaDoc','ERROR')
     28     msgbox_uvmat('ERROR','The size of image A needs to be defined in the xml file ImaDoc')
    2929     return
    3030 elseif isempty(npxB) || isempty(npyB)
    31       warndlg_uvmat('The size of image B needs to be defined in the xml file ImaDoc','ERROR')
     31      msgbox_uvmat('ERROR','The size of image B needs to be defined in the xml file ImaDoc')
    3232     return
    3333 end
     
    3535     tsaiA=XmlDataA.GeometryCalib;
    3636 else
    37      warndlg_uvmat('no geometric calibration available for image A','ERROR')
     37     msgbox_uvmat('ERROR','no geometric calibration available for image A')
    3838     return
    3939 end
     
    4141     tsaiB=XmlDataB.GeometryCalib;
    4242 else
    43      warndlg_uvmat('no geometric calibration available for image B','ERROR')
     43     msgbox_uvmat('ERROR','no geometric calibration available for image B')
    4444     return
    4545 end
     
    9898[Field,VelTypeOut]=read_civxdata(file_B,FieldNames,vel_type);
    9999if ~isequal(Field.dt,dt)
    100     warndlg_uvmat('different time intervals for the two velocity fields ','ERROR')
     100    msgbox_uvmat('ERROR','different time intervals for the two velocity fields ')
    101101     return
    102102end
    103103if ~isequal(Field.Time,time)
    104     warndlg_uvmat('different times for the two velocity fields ','ERROR')
     104    msgbox_uvmat('ERROR','different times for the two velocity fields ')
    105105     return
    106106end
     
    191191
    192192
    193 
    194 
    195 
    196 
    197 
    198 
    199 
    200 
    201 
    202 
     193%'pxcm_tsai': find differentials of the Tsai calibration
     194%
     195function [A11,A12,A13,A21,A22,A23]=pxcm_tsai(a,var_phys)
     196a_read=a;
     197
     198R=(a.R)';
     199
     200x=var_phys(:,1);
     201y=var_phys(:,2);
     202
     203if isfield(a,'PlanePos')
     204    prompt={'Plane 1 Index','Plane 2 Index'};
     205    Rep=inputdlg(prompt,'Target displacement test');
     206    Z1=str2double(Rep(1));
     207    Z2=str2double(Rep(2));
     208    z=(a.PlanePos(Z2,3)+a.PlanePos(Z1,3))/2
     209else
     210    z=0;
     211end
     212
     213%transform coeff for differentiels
     214a.C11=R(1)*R(8)-R(2)*R(7);
     215a.C12=R(2)*R(7)-R(1)*R(8);
     216a.C21=R(4)*R(8)-R(5)*R(7);
     217a.C22=R(5)*R(7)-R(4)*R(8);
     218a.C1x=R(3)*R(7)-R(9)*R(1);
     219a.C1y=R(3)*R(8)-R(9)*R(2);
     220a.C2x=R(6)*R(7)-R(9)*R(4);
     221a.C2y=R(6)*R(8)-R(9)*R(5);
     222
     223
     224%dependence in x,y
     225denom=(R(7)*x+R(8)*y+R(9)*z+a.Tz).*(R(7)*x+R(8)*y+R(9)*z+a.Tz);
     226A11=(a.f*a.sx*(a.C11*y-a.C1x*z+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx;
     227A12=(a.f*a.sx*(a.C12*x-a.C1y*z+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx;
     228A21=(a.f*a.sx*(a.C21*y-a.C2x*z+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy;
     229A22=(a.f*(a.C22*x-a.C2y*z+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy;
     230A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx;
     231A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy;
     232
     233%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     234%Old Version for z=0
     235%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     236% %'camera' coordinates
     237% xc=R(1)*x+R(2)*y+a.Tx;
     238% yc=R(4)*x+R(5)*y+a.Ty;
     239% zc=R(7)*x+R(8)*y+a.Tz;
     240% %undistorted image coordinates
     241% Xu=a.f*xc./zc;
     242% Yu=a.f*yc./zc;
     243% %distorted image coordinates
     244% distortion=(a.kappa1)*(Xu.*Xu+Yu.*Yu)+1; %!! intégrer derivation kappa
     245% % distortion=1;
     246% Xd=Xu./distortion;
     247% Yd=Yu./distortion;
     248% %pixel coordinates
     249% X=Xd*a.sx/a.dpx+a.Cx;
     250% Y=Yd/a.dpy+a.Cy;
     251%
     252% %transform coeff for differentiels
     253% a.C11=R(1)*R(8)-R(2)*R(7);
     254% a.C12=R(2)*R(7)-R(1)*R(8);
     255% a.C21=R(4)*R(8)-R(5)*R(7);
     256% a.C22=R(5)*R(7)-R(4)*R(8);
     257% a.C1x=R(3)*R(7)-R(9)*R(1);
     258% a.C1y=R(3)*R(8)-R(9)*R(2);
     259% a.C2x=R(6)*R(7)-R(9)*R(4);
     260% a.C2y=R(6)*R(8)-R(9)*R(5);
     261%
     262%
     263% %dependence in x,y
     264% denom=(R(7)*x+R(8)*y+a.Tz).*(R(7)*x+R(8)*y+a.Tz);
     265% A11=(a.f*a.sx*(a.C11*y+R(1)*a.Tz-R(7)*a.Tx)./denom)/a.dpx;
     266% A12=(a.f*a.sx*(a.C12*x+R(2)*a.Tz-R(8)*a.Tx)./denom)/a.dpx;
     267% A21=(a.f*a.sx*(a.C21*y+R(4)*a.Tz-R(7)*a.Ty)./denom)/a.dpy;
     268% A22=(a.f*(a.C22*x+R(5)*a.Tz-R(8)*a.Ty)./denom)/a.dpy;
     269% A13=(a.f*(a.C1x*x+a.C1y*y+R(3)*a.Tz-R(9)*a.Tx)./denom)/a.dpx;
     270% A23=(a.f*(a.C2x*x+a.C2y*y+R(6)*a.Tz-R(9)*a.Ty)./denom)/a.dpy;
     271%
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
Note: See TracChangeset for help on using the changeset viewer.