[1116] | 1 | %XmlData=xml2struct('/home/users/sommeria/UVMAT_DEMO_SOURCES/UVMAT_DEMO07_GeometryCalibration/multiple_planes/Dalsa1.xml'); |
---|
| 2 | GeometryCalib.CalibrationType='3D_quad'; |
---|
| 3 | GeometryCalib.fx_fy=[4.0839e+03 4.0839e+03]; |
---|
| 4 | GeometryCalib.Cx_Cy=[511.5000 512.5000]; |
---|
| 5 | GeometryCalib.kc=0.5; |
---|
| 6 | GeometryCalib.CoordUnit='cm'; |
---|
| 7 | GeometryCalib.Tx_Ty_Tz=[-47.9957 -48.4644 476.6510]; |
---|
| 8 | GeometryCalib.R=[0.9713 0.0518 -0.2320; -0.0813 0.9895 -0.1198; -0.2233 -0.1352 -0.9653]; |
---|
| 9 | %GeometryCalib.R=[0.9983 0.0485 -0.0332;-0.0500 0.9976 -0.0470;-0.0308 -0.0485 -0.9983] |
---|
| 10 | Slice.SliceCoord=[50 30 100]; |
---|
| 11 | Slice.SliceAngle=[10 20 0]; |
---|
| 12 | |
---|
| 13 | % Xpx=1000 |
---|
| 14 | % Ypx=1000 |
---|
| 15 | Xpx=1000 |
---|
| 16 | Ypx=1000 |
---|
| 17 | [Xphys,Yphys,Zphys]=phys_XYZ(GeometryCalib,Slice,Xpx,Ypx,1) |
---|
| 18 | [NewXpx,NewYpx]=px_XYZ(GeometryCalib,[],Xphys,Yphys,Zphys); |
---|
| 19 | disp(['error= ']) |
---|
| 20 | disp([NewXpx-Xpx NewYpx-Ypx]) |
---|
| 21 | |
---|
| 22 | % |
---|
| 23 | % |
---|
| 24 | % om=norm(GeometryCalib.SliceAngle);%norm of rotation angle in radians |
---|
| 25 | % OmAxis=GeometryCalib.SliceAngle/om; %unit vector marking the rotation axis |
---|
| 26 | % cos_om=cos(pi*om/180); |
---|
| 27 | % sin_om=sin(pi*om/180); |
---|
| 28 | % coeff=OmAxis(3)*(1-cos_om); |
---|
| 29 | % norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om; |
---|
| 30 | % norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om; |
---|
| 31 | % norm_plane(3)=OmAxis(3)*coeff+cos_om |
---|
| 32 | % |
---|
| 33 | % M=rodrigues(XmlData.GeometryCalib.SliceAngle*pi/180); |
---|
| 34 | % norm_plane=M*[0 0 1]' |
---|