修复注释乱码
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
// ============================================================================
|
||||
// 文件� AngleMeasurementProcessor.cs
|
||||
// æ��è¿°: 角度测é‡�ç®—å� â€?共端点的两æ�¡ç›´çº¿å¤¹è§’
|
||||
// 文件名: AngleMeasurementProcessor.cs
|
||||
// 描述: 角度测量算子 — 共端点的两条直线夹角
|
||||
// 功能:
|
||||
// - 用户定义三个点:端点(顶点)�射�终点�射�终点
|
||||
// - 计算两�射线之间的夹角(0°~180°�
|
||||
// - 用户定义三个点:端点(顶点)、射线1终点、射线2终点
|
||||
// - 计算两条射线之间的夹角(0°~180°)
|
||||
// - 在图像上绘制两条射线、角度弧线和标注
|
||||
// ============================================================================
|
||||
|
||||
using Emgu.CV;
|
||||
using Emgu.CV.Structure;
|
||||
using XP.ImageProcessing.Core;
|
||||
using Serilog;
|
||||
using System.Drawing;
|
||||
using XP.ImageProcessing.Core;
|
||||
|
||||
namespace XP.ImageProcessing.Processors;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class AngleMeasurementProcessor : ImageProcessorBase
|
||||
|
||||
protected override void InitializeParameters()
|
||||
{
|
||||
// 三个点å��æ ‡ï¼ˆç”±äº¤äº’æŽ§ä»¶æ³¨å…¥ï¼Œä½¿ç”¨ double é�¿å…�å�–整误差ï¼?
|
||||
// 三个点坐标(由交互控件注入,使用 double 避免取整误差)
|
||||
Parameters.Add("VX", new ProcessorParameter("VX", "VX", typeof(double), 250.0, null, null, "") { IsVisible = false });
|
||||
Parameters.Add("VY", new ProcessorParameter("VY", "VY", typeof(double), 250.0, null, null, "") { IsVisible = false });
|
||||
Parameters.Add("AX", new ProcessorParameter("AX", "AX", typeof(double), 100.0, null, null, "") { IsVisible = false });
|
||||
@@ -44,7 +44,7 @@ public class AngleMeasurementProcessor : ImageProcessorBase
|
||||
|
||||
OutputData.Clear();
|
||||
|
||||
// �� VA �VB
|
||||
// 向量 VA 和 VB
|
||||
double vax = ax - vx, vay = ay - vy;
|
||||
double vbx = bx - vx, vby = by - vy;
|
||||
|
||||
@@ -59,11 +59,11 @@ public class AngleMeasurementProcessor : ImageProcessorBase
|
||||
angleDeg = Math.Acos(cosAngle) * 180.0 / Math.PI;
|
||||
}
|
||||
|
||||
// 计算角度弧的起始角和扫过角(用于绘制弧线�
|
||||
// 计算角度弧的起始角和扫过角(用于绘制弧线)
|
||||
double angleA = Math.Atan2(vay, vax) * 180.0 / Math.PI;
|
||||
double angleB = Math.Atan2(vby, vbx) * 180.0 / Math.PI;
|
||||
|
||||
// 确��angleA �angleB 的扫过方�是较�的夹�
|
||||
// 确保从 angleA 到 angleB 的扫过方向是较小的夹角
|
||||
double sweep = angleB - angleA;
|
||||
if (sweep > 180) sweep -= 360;
|
||||
if (sweep < -180) sweep += 360;
|
||||
@@ -84,4 +84,4 @@ public class AngleMeasurementProcessor : ImageProcessorBase
|
||||
|
||||
return inputImage.Clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user