Changeset 1201 for trunk/src/px_XYZ.m
- Timestamp:
- Mar 23, 2026, 4:49:29 PM (3 hours ago)
- File:
-
- 1 edited
-
trunk/src/px_XYZ.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/px_XYZ.m
r1127 r1201 1 %'px_XYZ': transform physical to image coordinates.1 %'px_XYZ': transforms physical to image coordinates. 2 2 %------------------------------------------------------------------------ 3 %[X,Y]=px_XYZ(Calib, Xphys,Yphys,Zphys)3 %[X,Y]=px_XYZ(Calib,Slice,Xphys,Yphys,Zphys) 4 4 %------------------------------------------------------------------------ 5 5 % OUTPUT: … … 8 8 % INPUT: 9 9 % Calib: structure containing calibration parameters 10 % Slice: structure indicating the plane cut position 10 11 % Xphys,Yphys,Zphys; vectors of physical coordinates for a set of points 11 12 … … 41 42 %%%%%%%%%%%%% 42 43 if isempty(Slice) 43 Slice=Calib; 44 Slice=Calib;% old convention (< 2022) 44 45 end 45 46 % general case … … 51 52 if H>Zphys 52 53 Zphys=H-(H-Zphys)/Slice.RefractionIndex; %corrected z (virtual object)Calib 53 54 % test_refraction=1;55 54 end 56 55 end 57 56 58 57 %camera coordinates 59 Zphys=Zphys;%flip z coordinates60 58 xc=R(1)*Xphys+R(2)*Yphys+R(3)*Zphys+Calib.Tx_Ty_Tz(1); 61 59 yc=R(4)*Xphys+R(5)*Yphys+R(6)*Zphys+Calib.Tx_Ty_Tz(2); … … 69 67 if ~isfield(Calib,'kc') 70 68 r2=1; %no quadratic distortion 71 elseif numel(Calib.kc)==169 elseif isscalar(Calib.kc) 72 70 r2=1+Calib.kc*(Xu.*Xu+Yu.*Yu); 73 71 else
Note: See TracChangeset
for help on using the changeset viewer.
