Commit Graph

9 Commits

Author SHA1 Message Date
wei.lw.li 7768c086ea feat: 图像增强/变换算子标记高级参数+默认值优化
高级参数标记:Contrast(Contrast,Brightness,UseCLAHE,ClipLimit)、
Gamma(Gain)、Sharpen(Method,KernelSize)、Emboss(BlendRatio,GrayOffset)、
HistogramEq(Method,TileSize)、HDR(Method,Saturation,SigmaSpace,SigmaColor,Bias)、
Hierarchical(BaseGain,ClipLimit)、Retinex(Method,Sigma1/2/3,Offset)、
Rotate(ExpandCanvas,BackgroundValue,Interpolation)

默认值优化(适配平面CT DR图像):
- Sharpen: Laplacian→UnsharpMask(对噪声更温和)
- HistogramEq: Global→CLAHE(局部对比度更优)
- Contrast: AutoContrast默认开启
2026-08-12 09:25:34 +08:00
XplorePlane Developer 957157ae80 fix: 修复编译错误、BGA向导预览、算子重复插入及状态栏消息
## Compilation fixes
- Fix XAML namespace reference XplorePlane.Converters → XplorePlane.Helpers (EventLogView, StateDisplayView)
- Add missing using for ISampleTypeRepository / JsonSampleTypeRepository in App.xaml.cs
- Fix ILoggerService.Warn() calls using Exception as first arg instead of message string
- Serialize CncProgram to JSON when passing to MatrixLayout (expects string, not CncProgram object)
- Suppress CS8632 nullable annotation warnings project-wide

## BGA wizard fixes
- Fix preview not showing on step 3: force RefreshBgaPreview() when entering final step
- Add step validation in CanNext() to prevent skipping to preview with invalid inputs
- Notify NextCommand.CanExecuteChanged when inputs change
- Fix RunProgress runtime binding error: set Mode=OneWay for ProgressBar.Value

## Operator toolbox: prevent duplicate insertion
- Add static OperatorTarget property for direct dispatch to active pipeline
- PipelineEditorView registers as toolbox target on load (floating window only)
- CNC page sets initial target; PipelineEditorWindow resets to CNC pipeline on close
- '+' button inserts only to the active pipeline instead of broadcasting to all subscribers

## Pipeline editor status bar messages
- Add StatusBarMessageEvent / StatusBarMessagePayload to CommonEvents.cs
- PipelineEditorViewModel publishes status on all ops (add/remove/reorder/save/execute)
- MainViewModel subscribes and displays on main window bottom status bar
- Auto-clear after timeout (3s info, 5s error)

## docs
- Merge three architecture docs into consolidated XplorePlane-架构与结构说明.md
2026-07-24 15:59:16 +08:00
wei.lw.li 85045d45e2 fix(processors): 修复对比度与阈值算子16位分支的降位精度损失
- ContrastProcessor: CLAHE分支改用原生CvInvoke.CLAHE(支持CV_16U),不再16→8→16往返
- ThresholdProcessor: Otsu分支在16位完整直方图(65536 bin)上原生计算最优阈值
2026-07-21 10:05:13 +08:00
wei.lw.li 34f3eb78ce fix: 修复图像处理算子内存泄漏和健壮性问题
ContrastProcessor: 修复AutoContrastStretch中floatImage重新赋值导致的内存泄漏, 修复线性模式brightness调整时result+覆盖中间图像泄漏

MorphologyProcessor: switch添加default分支防止未处理的结构元素类型

MultiplicationProcessor/BilateralFilterProcessor/PixelDepthHelper: 相关16位处理优化
2026-07-20 15:45:33 +08:00
wei.lw.li 90bff74caf fix: 修复16位TIFF图像加载时精度丢失导致的色带问题
根本原因:WPF的BitmapImage加载16位灰度TIFF时自动转换为Bgr32(8位)格式,
导致原始16位精度(8976个灰度级)被压缩为约35个灰度级,产生明显色带。

修复内容:
- MainViewModel.ExecuteLoadImage: TIFF文件改用TiffBitmapDecoder+PreservePixelFormat加载
- PipelineEditorViewModel.LoadImageFromFile: 同样修复TIFF加载方式
- XP.Common.Converters.ImageConverter: ConvertGray16ToBitmapSource直接输出Gray16格式
- ImageConverter.ToBitmapSourceAutoNormalize: 采用ImageJ风格的线性映射显示算法
2026-07-20 11:49:42 +08:00
李伟 ecc58a5819 feat(算子库): 50个算子升级为泛型,同时支持 8位/16位灰度图像处理
泛型算子(ImageProcessorBase<TDepth>,byte/ushort 均支持):
- 滤波处理:GaussianBlur、MeanFilter、MedianFilter、BilateralFilter
             HighPassFilter、LowPassFilter、BandPassFilter、ShockFilter
- 边缘检测:SobelEdge、KirschEdge、HorizontalEdge
- 图像变换:Grayscale、Mirror、Rotate、Threshold
- 图像增强:Contrast、Gamma(LUT 升级为 ushort[65536])、Sharpen、SubPixelZoom
- 数学运算:Difference、Multiplication、Division、Integral、Or
- 其他:FilmEffect(窗宽窗位参数扩展至 0-65535)、MorphologyProcessor
- 检测分析:EdgeLineFit、EdgeCircleFit(卡尺剖面读取支持 16 位灰度)

保持 8位专用(ImageProcessorBase<byte>):
- 轮廓/椭圆检测、BGA/QFN/Void 检测、模板匹配等需要 FindContours/CV_8U 的算子

新增:
- VoidMeasurementProcessor16:16位专用包装类,阈值参数范围 0-65535
- VoidMeasurementProcessor/BgaVoidRateProcessor 阈值参数范围扩至 65535
2026-06-16 13:00:15 +08:00
李伟 030433cc92 优化:修复Logger类型错误,重写CLAHE算法,像素遍历改用unsafe指针加速 2026-05-26 13:28:52 +08:00
李伟 cd03e30bb8 修复注释乱码 2026-04-14 17:12:31 +08:00
李伟 ace1c70ddf 规范类名及命名空间名称 2026-04-13 14:36:18 +08:00