增加校准通用代码
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace XP.Calibration.Models;
|
||||
|
||||
/// <summary>
|
||||
/// 椭圆拟合结果 | Ellipse fitting result
|
||||
/// </summary>
|
||||
public record EllipseResult
|
||||
{
|
||||
public PointF Center { get; init; }
|
||||
public float LongAxis { get; init; }
|
||||
public float ShortAxis { get; init; }
|
||||
public float Angle { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 几何参数 | Geometry parameters for CT system
|
||||
/// </summary>
|
||||
public class GeoParams
|
||||
{
|
||||
/// <summary>焦点到旋转中心距离 (mm) | Distance Source to Origin</summary>
|
||||
public double DSO { get; set; }
|
||||
/// <summary>焦点到探测器距离 (mm) | Distance Source to Detector</summary>
|
||||
public double DSD { get; set; }
|
||||
/// <summary>探测器像素大小 (mm) | Detector pixel size</summary>
|
||||
public double PixelSize { get; set; }
|
||||
/// <summary>探测器水平像素数 | Detector horizontal pixel count</summary>
|
||||
public int NDetecU { get; set; }
|
||||
/// <summary>探测器垂直像素数 | Detector vertical pixel count</summary>
|
||||
public int NDetecV { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 中心校准结果 | Center calibration result
|
||||
/// </summary>
|
||||
public record CenterCalibrationResult
|
||||
{
|
||||
/// <summary>椭圆拟合结果</summary>
|
||||
public EllipseResult Ellipse { get; init; } = null!;
|
||||
/// <summary>倾斜角 (度) | Tilt angle in degrees</summary>
|
||||
public double AlphaDeg { get; init; }
|
||||
/// <summary>反算半径 R (mm)</summary>
|
||||
public double R_mm { get; init; }
|
||||
/// <summary>透视偏移量 (像素) | Perspective offset in pixels</summary>
|
||||
public double DeltaPx { get; init; }
|
||||
/// <summary>修正后焦点投影 U 坐标</summary>
|
||||
public double FocalU { get; init; }
|
||||
/// <summary>修正后焦点投影 V 坐标</summary>
|
||||
public double FocalV { get; init; }
|
||||
/// <summary>各帧检测到的球心坐标</summary>
|
||||
public List<PointF> DetectedCenters { get; init; } = new();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace XP.Calibration.Models;
|
||||
|
||||
/// <summary>
|
||||
/// 完整几何校准选项 | Options for full geometric calibration
|
||||
/// </summary>
|
||||
public class FullCalibrationOptions
|
||||
{
|
||||
/// <summary>是否优化探测器偏移 offDetecU/V</summary>
|
||||
public bool OptimizeDetectorOffset { get; set; } = false;
|
||||
/// <summary>是否优化 DSO/DSD 距离</summary>
|
||||
public bool OptimizeDistances { get; set; } = false;
|
||||
/// <summary>LM 最大迭代次数</summary>
|
||||
public int MaxIterations { get; set; } = 5000;
|
||||
/// <summary>收敛阈值</summary>
|
||||
public double Tolerance { get; set; } = 1e-16;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
namespace XP.Calibration.Models;
|
||||
|
||||
/// <summary>
|
||||
/// 完整几何校准结果 | Full geometric calibration result
|
||||
/// </summary>
|
||||
public record FullCalibrationResult
|
||||
{
|
||||
/// <summary>旋转轴倾斜角 ay (度) | Rotation axis tilt, angles[:,1]</summary>
|
||||
public double AyDeg { get; init; }
|
||||
/// <summary>探测器 dPitch (度) | Detector pitch, rotDet[:,1]</summary>
|
||||
public double DetYDeg { get; init; }
|
||||
/// <summary>探测器 dYaw (度) | Detector yaw, rotDet[:,0]</summary>
|
||||
public double DetXDeg { get; init; }
|
||||
/// <summary>探测器 dRoll (度) | Detector roll, rotDet[:,2]</summary>
|
||||
public double DetZDeg { get; init; }
|
||||
/// <summary>物体偏移 R (mm) | Object offset radius</summary>
|
||||
public double R_mm { get; init; }
|
||||
/// <summary>探测器水平偏移 (mm) | Detector U offset</summary>
|
||||
public double OffDetecU_mm { get; init; }
|
||||
/// <summary>探测器垂直偏移 (mm) | Detector V offset</summary>
|
||||
public double OffDetecV_mm { get; init; }
|
||||
/// <summary>优化后 DSO (mm)</summary>
|
||||
public double DSO_mm { get; init; }
|
||||
/// <summary>优化后 DSD (mm)</summary>
|
||||
public double DSD_mm { get; init; }
|
||||
/// <summary>RMS 残差 (像素) | RMS residual in pixels</summary>
|
||||
public double RmsPx { get; init; }
|
||||
/// <summary>是否收敛 | Whether optimization converged</summary>
|
||||
public bool Converged { get; init; }
|
||||
}
|
||||
Reference in New Issue
Block a user