当前位置:网站首页>OpenCV 6.4 中值滤波器的使用
OpenCV 6.4 中值滤波器的使用
2022-07-02 06:28:00 【Villanelle#】
非线性滤波器
前几节介绍的均值滤波器、高斯滤波器均为线性滤波器,即用邻域像素的加权累加值替换像素值。
本节主要介绍非线性滤波器,其没有内核,且不能进行卷积运算,但也是通过识别邻域像素值来确定输出的像素值的。
常用的非线性滤波器有中值滤波器,中值滤波器把当前像素和其邻域组成集合,计算集合的中间值作为当前像素值,它在消除椒盐噪声方面非常有效。
cv::Mat image = cv::imread("salted.bmp");
cv::Mat median;
cv::medianBlur(image, median, 5);
cv::imshow("image", image);
cv::imshow("median blur", median);



可以很明显的看出,中值滤波器在消除噪声方面非常高效,可以很好的识别异常的黑色或白色像素进而将其替换,而均值滤波器会很大程度上受到噪声影响。
此外中值滤波器有利于保留边缘的尖锐度,但会洗去均质区域中的纹理,会有良好的视觉效果,类似水墨风格。
cv::medianBlur函数的使用
函数签名
CV_EXPORTS_W void medianBlur( InputArray src, OutputArray dst, int ksize );
- 参数分别为:输入图像,输出图像,滤波器尺寸。
- 可以通过修改不同的滤波器尺寸实现不同的效果。下图是将滤波器尺寸改为9时的效果。

边栏推荐
- 【FastDepth】《FastDepth:Fast Monocular Depth Estimation on Embedded Systems》
- Apple added the first iPad with lightning interface to the list of retro products
- 【MobileNet V3】《Searching for MobileNetV3》
- 用MLP代替掉Self-Attention
- 针对tqdm和print的顺序问题
- 联邦学习下的数据逆向攻击 -- GradInversion
- [binocular vision] binocular stereo matching
- 業務架構圖
- 【双目视觉】双目矫正
- Graph Pooling 简析
猜你喜欢

【DIoU】《Distance-IoU Loss:Faster and Better Learning for Bounding Box Regression》

11月24号,我们为“满月”庆祝

【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》

Dynamic extensible representation for category incremental learning -- der

Principes fondamentaux de la théorie musicale (brève introduction)

针对tqdm和print的顺序问题

Remplacer l'auto - attention par MLP

Where do you find the materials for those articles that have read 10000?

How to clean up logs on notebook computers to improve the response speed of web pages

What if a new window always pops up when opening a folder on a laptop
随机推荐
Find and rfind methods in string
C#与MySQL数据库连接
STL速查手册
【雙目視覺】雙目矯正
【学习笔记】反向误差传播之数值微分
Simply test the two different data transmission methods of content length and chunked
浅谈深度学习模型中的后门
王-课外单词
One book 1078: sum of fractional sequences
【FastDepth】《FastDepth:Fast Monocular Depth Estimation on Embedded Systems》
The hystrix dashboard reported an error hystrix Stream is not in the allowed list of proxy host names solution
Open3d learning note 5 [rgbd fusion]
Global and Chinese markets for magnetic resonance imaging (MRI) transmission 2022-2028: Research Report on technology, participants, trends, market size and share
Target detection for long tail distribution -- balanced group softmax
What if the notebook computer cannot run the CMD command
笔记本电脑卡顿问题原因
E-R画图明确内容
【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
install.img制作方式
【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》