Changeset 1109
- Timestamp:
- Jan 7, 2022, 1:19:15 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/phys_XYZ.m
r1108 r1109 41 41 if isfield(Calib, 'SliceAngle') && size(Calib.SliceAngle,1)>=Zindex && ~isequal(Calib.SliceAngle(Zindex,:),[0 0 0]) 42 42 testangle=1; 43 norm_plane=angle2normal(Calib.SliceAngle(Zindex,:));% coordinates of the unit vector normal to the current illumination plane43 norm_plane=angle2normal(Calib.SliceAngle(Zindex,:));% coordinates UVMAT-httpsof the unit vector normal to the current illumination plane 44 44 end 45 45 Z0=Calib.SliceCoord(Zindex,3);%horizontal plane z=cte … … 84 84 avirt=a/Calib.RefractionIndex; 85 85 bvirt=b/Calib.RefractionIndex; 86 else 87 avirt=a; 88 bvirt=b; 86 89 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) 88 91 % c=z coordinate at (x,y)=(0,0) 89 92 R(1)=R(1)+avirt*R(3); … … 106 109 Zx0=R(3)*R(5)-R(2)*R(6); 107 110 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; 114 117 %px to camera: 115 118 Xd=(X-Calib.Cx_Cy(1))/Calib.fx_fy(1); % sensor coordinates … … 130 133 Yphys=(B21.*Xu+B22.*Yu+Y0)./denom; 131 134 if testangle 132 Zphys= Z0+a*Xphys+b*Yphys;135 Zphys=c+a*Xphys+b*Yphys; 133 136 else 134 137 Zphys=Z0;
Note: See TracChangeset
for help on using the changeset viewer.