均值滤波+高斯平滑+中值滤波+各向异性滤波

本文详细介绍了四种图像滤波技术:均值滤波、高斯平滑、中值滤波和各向异性滤波。提供了每种技术的关键代码实现及对应的VTK demo地址,帮助读者理解并实践这些滤波方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

51CTO详解:
均值滤波:http://book.51cto.com/art/201504/474128.htm
高斯平滑:http://book.51cto.com/art/201504/474129.htm
中值滤波:http://book.51cto.com/art/201504/474130.htm
各向异性滤波:http://book.51cto.com/art/201504/474131.htm

demo地址:
均值滤波:https://lorensen.github.io/VTKExamples/site/Cxx/Images/ImageConvolve/
高斯平滑:https://lorensen.github.io/VTKExamples/site/Cxx/Images/ImageGaussianSmooth/
中值滤波:https://lorensen.github.io/VTKExamples/site/Cxx/Images/ImageHybridMedian2D/
各向异性滤波:https://lorensen.github.io/VTKExamples/site/Cxx/Images/ImageAnisotropicDiffusion2D/

均值滤波关键代码:

  vtkSmartPointer<vtkImageConvolve> convolveFilter =
    vtkSmartPointer<vtkImageConvolve>::New();
  convolveFilter->SetInputConnection(source->GetOutputPort());
  double kernel[9] = {1,1,1,1,1,1,1,1,1};
  convolveFilter->SetKernel3x3(kernel);
  convolveFilter->Update();

效果图:
这里写图片描述

高斯平滑关键代码:

  vtkSmartPointer<vtkImageGaussianSmooth> gaussianSmoothFilter = 
    vtkSmartPointer<vtkImageGaussianSmooth>::New();
  gaussianSmoothFilter->SetInputConnection(source->GetOutputPort());
  gaussianSmoothFilter->Update();

效果图:
这里写图片描述
中值滤波关键代码:

  vtkSmartPointer<vtkImageHybridMedian2D> hybridMedian =
    vtkSmartPointer<vtkImageHybridMedian2D>::New();
  hybridMedian->SetInputConnection(reader->GetOutputPort());

效果图:
这里写图片描述
各向异性滤波关键代码:

  vtkSmartPointer<vtkImageAnisotropicDiffusion2D> diffusion =
    vtkSmartPointer<vtkImageAnisotropicDiffusion2D>::New();
  diffusion->SetInputConnection(reader->GetOutputPort());
  diffusion->SetNumberOfIterations(iterations);
  diffusion->SetDiffusionThreshold(threshold);
  diffusion->Update();

效果图:
这里写图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值