修复注释乱码

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,26 +1,26 @@
// ============================================================================
// Copyright © 2026 Hexagon Technology Center GmbH. All Rights Reserved.
// 文件å? FillRateProcessor.cs
// 文件名: FillRateProcessor.cs
// 描述: 通孔填锡率测量算子(倾斜投影几何法),基于四椭圆ROI
// 功能:
// - æ ·å“倾斜çº?5°放置,利用投影ä½ç§»å…³ç³»è®¡ç®—填锡率
// - 四个椭圆定义�
// - 样品倾斜约45°放置,利用投影位移关系计算填锡率
// - 四个椭圆定义:
// E1 = 通孔底部轮廓
// E2 = 通孔顶部轮廓
// E3 = 填锡起点(与E1é‡åˆï¼Œä»£è¡?%填锡ï¼?
// E4 = 填锡终点(锡实际填充到的高度�
// - 填锡�= |E4中心 - E3中心| / |E2中心 - E1中心| × 100%
// - 纯几何方法,ä¸ä¾èµ–ç°åº¦åˆ†æž?
// - IPC-610 THT 分级判定(Class 1/2/3�
// E3 = 填锡起点(与E1重合,代表0%填锡)
// E4 = 填锡终点(锡实际填充到的高度)
// - 填锡率 = |E4中心 - E3中心| / |E2中心 - E1中心| × 100%
// - 纯几何方法,不依赖灰度分析
// - IPC-610 THT 分级判定(Class 1/2/3
// 算法: 倾斜投影位移比例
// 作è€? æŽä¼Ÿ wei.lw.li@hexagon.com
// 作者: 李伟 wei.lw.li@hexagon.com
// ============================================================================
using Emgu.CV;
using Emgu.CV.Structure;
using XP.ImageProcessing.Core;
using Serilog;
using System.Drawing;
using XP.ImageProcessing.Core;
namespace XP.ImageProcessing.Processors;
@@ -42,7 +42,7 @@ public class FillRateProcessor : ImageProcessorBase
// 四个椭圆(由交互控件注入,UI不可见)
AddEllipseParams("E1", 200, 250, 60, 50, 0); // 底部
AddEllipseParams("E2", 220, 180, 60, 50, 0); // 顶部
AddEllipseParams("E3", 200, 250, 60, 50, 0); // 填锡起点�E1�
AddEllipseParams("E3", 200, 250, 60, 50, 0); // 填锡起点(=E1
AddEllipseParams("E4", 210, 220, 55, 45, 0); // 填锡终点
Parameters.Add("THTLimit", new ProcessorParameter(
@@ -78,7 +78,7 @@ public class FillRateProcessor : ImageProcessorBase
int e3cx = GetParameter<int>("E3_CX"), e3cy = GetParameter<int>("E3_CY");
int e4cx = GetParameter<int>("E4_CX"), e4cy = GetParameter<int>("E4_CY");
// èŽ·å–æ¤­åœ†è½´å‚数(用于绘制ï¼?
// 获取椭圆轴参数(用于绘制)
double e1a = GetParameter<double>("E1_A"), e1b = GetParameter<double>("E1_B"), e1ang = GetParameter<double>("E1_Angle");
double e2a = GetParameter<double>("E2_A"), e2b = GetParameter<double>("E2_B"), e2ang = GetParameter<double>("E2_Angle");
double e3a = GetParameter<double>("E3_A"), e3b = GetParameter<double>("E3_B"), e3ang = GetParameter<double>("E3_Angle");
@@ -89,17 +89,17 @@ public class FillRateProcessor : ImageProcessorBase
OutputData.Clear();
// 计算通孔全高度的投影ä½ç§»ï¼ˆE1底部 â†?E2顶部ï¼?
// 计算通孔全高度的投影位移(E1底部 → E2顶部)
double fullDx = e2cx - e1cx;
double fullDy = e2cy - e1cy;
double fullDistance = Math.Sqrt(fullDx * fullDx + fullDy * fullDy);
// 计算填锡高度的投影ä½ç§»ï¼ˆE3起点 â†?E4终点ï¼?
// 计算填锡高度的投影位移(E3起点 → E4终点)
double fillDx = e4cx - e3cx;
double fillDy = e4cy - e3cy;
double fillDistance = Math.Sqrt(fillDx * fillDx + fillDy * fillDy);
// 填锡çŽ?= 填锡ä½ç§» / 全高度ä½ç§?
// 填锡率 = 填锡位移 / 全高度位移
double fillRate = fullDistance > 0 ? (fillDistance / fullDistance) * 100.0 : 0;
fillRate = Math.Clamp(fillRate, 0, 100);
@@ -130,4 +130,4 @@ public class FillRateProcessor : ImageProcessorBase
return inputImage.Clone();
}
}
}