修复注释乱码

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,21 +1,22 @@
// ============================================================================
// Copyright © 2026 Hexagon Technology Center GmbH. All Rights Reserved.
// 文件å? FilmEffectProcessor.cs
// æè¿°: 电å­èƒ¶ç‰‡æ•ˆæžœç®—å­ï¼Œæ¨¡æ‹Ÿä¼ ç»ŸX射线胶片的显示效æž?
// 文件名: FilmEffectProcessor.cs
// 描述: 电子胶片效果算子,模拟传统X射线胶片的显示效果
// 功能:
// - 窗宽窗ä½ï¼ˆWindow/Level)调æ•?
// - 胶片å转(正ç‰?负片ï¼?
// - 窗宽窗位(Window/Level)调整
// - 胶片反转(正片/负片)
// - 多种胶片特性曲线(线性、S曲线、对数、指数)
// - 边缘增强(模拟胶片锐化效果)
// - 使用查找表(LUT)加速处ç?
// 算法: çª—å®½çª—ä½æ˜ å°„ + ç‰¹æ€§æ›²çº¿å˜æ?
// 作è€? æŽä¼Ÿ wei.lw.li@hexagon.com
// - 使用查找表(LUT)加速处理
// 算法: 窗宽窗位映射 + 特性曲线变换
// 作者: 李伟 wei.lw.li@hexagon.com
// ============================================================================
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
using Serilog;
using XP.ImageProcessing.Core;
using Serilog;
namespace XP.ImageProcessing.Processors;
@@ -102,7 +103,7 @@ public class FilmEffectProcessor : ImageProcessorBase
double curveStrength = GetParameter<double>("CurveStrength");
double edgeEnhance = GetParameter<double>("EdgeEnhance");
// 构建查找�
// 构建查找表
BuildLUT(windowCenter, windowWidth, invert, curve, curveStrength);
// 应用 LUT
@@ -149,14 +150,14 @@ public class FilmEffectProcessor : ImageProcessorBase
for (int i = 0; i < 256; i++)
{
// çª—å®½çª—ä½æ˜ å°„åˆ?[0, 1]
// 窗宽窗位映射到 [0, 1]
double normalized;
if (ww <= 1)
normalized = i >= wc ? 1.0 : 0.0;
else
normalized = Math.Clamp((i - low) / (high - low), 0.0, 1.0);
// 应用特性曲�
// 应用特性曲线
double mapped = curve switch
{
"Sigmoid" => ApplySigmoid(normalized, strength),
@@ -1,25 +1,25 @@
// ============================================================================
// Copyright © 2026 Hexagon Technology Center GmbH. All Rights Reserved.
// 文件å? PseudoColorProcessor.cs
// 文件名: PseudoColorProcessor.cs
// 描述: 伪色彩渲染算子,将灰度图像映射为彩色图像
// 功能:
// - 支持多种 OpenCV 内置色彩映射表(Jet、Hot、Cool、Rainbow 等)
// - 可选灰度范围裁剪,突出感兴趣的灰度区间
// - å¯é€‰å转色彩映射方å?
// 算法: 查找表(LUT)色彩映�
// 作è€? æŽä¼Ÿ wei.lw.li@hexagon.com
// - 可选反转色彩映射方向
// 算法: 查找表(LUT)色彩映射
// 作者: 李伟 wei.lw.li@hexagon.com
// ============================================================================
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
using Serilog;
using XP.ImageProcessing.Core;
using Serilog;
namespace XP.ImageProcessing.Processors;
/// <summary>
/// 伪色彩渲染算�
/// 伪色彩渲染算子
/// </summary>
public class PseudoColorProcessor : ImageProcessorBase
{
@@ -82,11 +82,11 @@ public class PseudoColorProcessor : ImageProcessorBase
OutputData.Clear();
// ç°åº¦èŒƒå›´è£å‰ªä¸Žå½’一åŒ?
// 灰度范围裁剪与归一化
Image<Gray, byte> normalized;
if (minValue > 0 || maxValue < 255)
{
// �[minValue, maxValue] 映射�[0, 255]
// [minValue, maxValue] 映射到 [0, 255]
normalized = inputImage.Clone();
double scale = 255.0 / Math.Max(maxValue - minValue, 1);
for (int y = 0; y < normalized.Height; y++)
@@ -135,7 +135,7 @@ public class PseudoColorProcessor : ImageProcessorBase
var colorImage = colorMat.ToImage<Bgr, byte>();
// 将彩色图åƒå­˜å…?OutputData,供 UI 显示
// 将彩色图像存入 OutputData,供 UI 显示
OutputData["PseudoColorImage"] = colorImage;
_logger.Debug("Process: ColorMap={ColorMap}, MinValue={Min}, MaxValue={Max}, InvertMap={Invert}",