修复注释乱码

This commit is contained in:
李伟
2026-04-14 17:11:31 +08:00
parent b8bcefc84b
commit cd03e30bb8
58 changed files with 761 additions and 767 deletions
@@ -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();
}
}
}