修复注释乱码
This commit is contained in:
@@ -1,21 +1,22 @@
|
||||
// ============================================================================
|
||||
// Copyright © 2026 Hexagon Technology Center GmbH. All Rights Reserved.
|
||||
// 文件� PointToLineProcessor.cs
|
||||
// 文件名: PointToLineProcessor.cs
|
||||
// 描述: 点到直线距离测量算子
|
||||
// 功能:
|
||||
// - 用户定义一条直线(两个端点)和一个测量点
|
||||
// - 计算测�点到直线的垂直��
|
||||
// - 计算测量点到直线的垂直距离
|
||||
// - 支持像素尺寸标定输出物理距离
|
||||
// - 在图像上绘制直线、测量点、垂足和距离标注
|
||||
// 算法: 点到直线距离公式
|
||||
// 作� �伟 wei.lw.li@hexagon.com
|
||||
// 作者: 李伟 wei.lw.li@hexagon.com
|
||||
// ============================================================================
|
||||
|
||||
using Emgu.CV;
|
||||
using Emgu.CV.CvEnum;
|
||||
using Emgu.CV.Structure;
|
||||
using XP.ImageProcessing.Core;
|
||||
using Serilog;
|
||||
using System.Drawing;
|
||||
using XP.ImageProcessing.Core;
|
||||
|
||||
namespace XP.ImageProcessing.Processors;
|
||||
|
||||
@@ -31,7 +32,7 @@ public class PointToLineProcessor : ImageProcessorBase
|
||||
|
||||
protected override void InitializeParameters()
|
||||
{
|
||||
// 直线两端�+ 测�点(由交互控件注入)
|
||||
// 直线两端点 + 测量点(由交互控件注入)
|
||||
Parameters.Add("L1X", new ProcessorParameter("L1X", "L1X", typeof(int), 100, null, null, "") { IsVisible = false });
|
||||
Parameters.Add("L1Y", new ProcessorParameter("L1Y", "L1Y", typeof(int), 200, null, null, "") { IsVisible = false });
|
||||
Parameters.Add("L2X", new ProcessorParameter("L2X", "L2X", typeof(int), 400, null, null, "") { IsVisible = false });
|
||||
@@ -79,7 +80,7 @@ public class PointToLineProcessor : ImageProcessorBase
|
||||
|
||||
if (abLen > 0.001)
|
||||
{
|
||||
// �积求��
|
||||
// 叉积求距离
|
||||
double cross = Math.Abs(abx * (l1y - py) - aby * (l1x - px));
|
||||
pixelDistance = cross / abLen;
|
||||
|
||||
@@ -112,4 +113,4 @@ public class PointToLineProcessor : ImageProcessorBase
|
||||
|
||||
return inputImage.Clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user