新增 ROI 对齐基础能力并打通到算子与 UI。

统一补齐对齐核心工具类、RoiAlignment 算子、模板匹配对齐扩展和多语言资源,便于在检测前稳定完成示教 ROI 到运行图的变换。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
李伟
2026-06-01 17:04:32 +08:00
parent b0397365b2
commit 1874c4a5bb
15 changed files with 790 additions and 1 deletions
@@ -24,4 +24,19 @@ public static class TemplateMatchAlignmentExtensions
result.LbX,
result.LbY,
tolerancePixels);
/// <summary>从 RotatedTemplateMatching 的 OutputData 读取测量位姿。</summary>
public static bool TryReadMeasuredPose(
IReadOnlyDictionary<string, object>? outputData,
out Pose2D measuredPose,
out string? errorMessage,
int matchIndex = 0)
=> TemplateMatchOutputReader.TryReadMeasuredPose(outputData, out measuredPose, out errorMessage, matchIndex);
/// <summary>用匹配结果 + 示教配方一步得到对齐后的 ROI。</summary>
public static RoiAlignmentResult AlignRecipe(
AlignmentRecipe recipe,
IReadOnlyDictionary<string, object>? templateMatchOutput,
int matchIndex = 0)
=> RoiAlignmentApplier.ApplyFromTemplateMatchOutput(recipe, templateMatchOutput, matchIndex);
}