namespace XP.ImageProcessing.Core.Alignment; /// /// 图像平面上的刚体位姿:绕 / 旋转 (度)。 /// 与 TemplateMatchLib 的 CenterX/CenterY/Angle 约定一致。 /// public readonly record struct Pose2D(double X, double Y, double AngleDegrees) { /// 示教/标准姿态(角度 0,中心由调用方指定)。 public static Pose2D IdentityAt(double x, double y) => new(x, y, 0); /// /// 由模板学习 ROI 矩形估计示教位姿中心(pattern 几何中心),角度默认 0。 /// 更稳妥的做法是在示教图上自匹配得到 。 /// public static Pose2D FromTemplateRoiCenter(int roiX, int roiY, int roiWidth, int roiHeight, double angleDegrees = 0) => new(roiX + roiWidth * 0.5, roiY + roiHeight * 0.5, angleDegrees); }