Changeset 1109 for trunk


Ignore:
Timestamp:
Jan 7, 2022, 1:19:15 PM (6 months ago)
Author:
sommeria
Message:

phys_XYZ modified for angular scan, bug corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/phys_XYZ.m

    r1108 r1109  
    4141    if isfield(Calib, 'SliceAngle') && size(Calib.SliceAngle,1)>=Zindex && ~isequal(Calib.SliceAngle(Zindex,:),[0 0 0])
    4242        testangle=1;
    43         norm_plane=angle2normal(Calib.SliceAngle(Zindex,:));% coordinates of the unit vector normal to the current illumination plane
     43        norm_plane=angle2normal(Calib.SliceAngle(Zindex,:));% coordinates UVMAT-httpsof the unit vector normal to the current illumination plane
    4444    end
    4545    Z0=Calib.SliceCoord(Zindex,3);%horizontal plane z=cte
     
    8484            avirt=a/Calib.RefractionIndex;
    8585            bvirt=b/Calib.RefractionIndex;
     86        else
     87            avirt=a;
     88            bvirt=b;
    8689        end
    87         c=Z0virt-avirt*Calib.SliceCoord(Zindex,1)-bvirt*Calib.SliceCoord(Zindex,2);% Z0 = (virtual) z coordinate on the rotation axis (assumed horizontal)
     90        cvirt=Z0virt-avirt*Calib.SliceCoord(Zindex,1)-bvirt*Calib.SliceCoord(Zindex,2);% Z0 = (virtual) z coordinate on the rotation axis (assumed horizontal)
    8891                               % c=z coordinate at (x,y)=(0,0)
    8992        R(1)=R(1)+avirt*R(3);
     
    106109     Zx0=R(3)*R(5)-R(2)*R(6);
    107110     Zy0=R(1)*R(6)-R(3)*R(4);
    108     B11=R(8)*Ty-R(5)*Tz+Z11*c;
    109     B12=R(2)*Tz-R(8)*Tx+Z12*c;
    110     B21=-R(7)*Ty+R(4)*Tz+Z21*c;
    111     B22=-R(1)*Tz+R(7)*Tx+Z22*c;
    112     X0=(R(5)*Tx-R(2)*Ty+Zx0*c);
    113     Y0=(-R(4)*Tx+R(1)*Ty+Zy0*c);
     111    B11=R(8)*Ty-R(5)*Tz+Z11*cvirt;
     112    B12=R(2)*Tz-R(8)*Tx+Z12*cvirt;
     113    B21=-R(7)*Ty+R(4)*Tz+Z21*cvirt;
     114    B22=-R(1)*Tz+R(7)*Tx+Z22*cvirt;
     115    X0=R(5)*Tx-R(2)*Ty+Zx0*cvirt;
     116    Y0=-R(4)*Tx+R(1)*Ty+Zy0*cvirt;
    114117    %px to camera:
    115118    Xd=(X-Calib.Cx_Cy(1))/Calib.fx_fy(1); % sensor coordinates
     
    130133    Yphys=(B21.*Xu+B22.*Yu+Y0)./denom;
    131134    if testangle
    132         Zphys=Z0+a*Xphys+b*Yphys;
     135        Zphys=c+a*Xphys+b*Yphys;
    133136    else
    134137        Zphys=Z0;
Note: See TracChangeset for help on using the changeset viewer.