using XP.ImageProcessing.Core.Alignment;
namespace XP.ImageProcessing.Processors;
///
/// 将 TemplateMatchLib 匹配结果转换为对齐工具使用的 。
///
public static class TemplateMatchAlignmentExtensions
{
public static Pose2D ToPose2D(this TM_Result result)
=> new(result.CenterX, result.CenterY, result.Angle);
/// 四角质心是否与 Center 一致(容差默认 1 像素)。
public static bool IsCenterConsistentWithCorners(this TM_Result result, double tolerancePixels = 1.0)
=> RoiAlignment.IsMatchCenterConsistentWithCorners(
result.CenterX,
result.CenterY,
result.LtX,
result.LtY,
result.RtX,
result.RtY,
result.RbX,
result.RbY,
result.LbX,
result.LbY,
tolerancePixels);
}