当前位置:网站首页>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时的效果。
边栏推荐
- 关于原型图的深入理解
- 【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》
- 用于类别增量学习的动态可扩展表征 -- DER
- Embedding malware into neural networks
- In the era of short video, how to ensure that works are more popular?
- Global and Chinese market of tillage finishing machines 2022-2028: Research Report on technology, participants, trends, market size and share
- Mmdetection trains its own data set -- export coco format of cvat annotation file and related operations
- 業務架構圖
- 【DIoU】《Distance-IoU Loss:Faster and Better Learning for Bounding Box Regression》
- Backup, recovery and repair of XFS file system
猜你喜欢
简易打包工具的安装与使用
【Cascade FPD】《Deep Convolutional Network Cascade for Facial Point Detection》
【学习笔记】Matlab自编图像卷积函数
用MLP代替掉Self-Attention
What if the laptop can't search the wireless network signal
EKLAVYA -- 利用神经网络推断二进制文件中函数的参数
Network metering - transport layer
Graph Pooling 简析
用于类别增量学习的动态可扩展表征 -- DER
[learning notes] numerical differentiation of back error propagation
随机推荐
[learning notes] matlab self compiled image convolution function
How gensim freezes some word vectors for incremental training
AR system summary harvest
Find and rfind methods in string
最长等比子序列
Meta Learning 简述
【双目视觉】双目矫正
Global and Chinese market of recovery equipment 2022-2028: Research Report on technology, participants, trends, market size and share
Rhel7 operation level introduction and switching operation
【DIoU】《Distance-IoU Loss:Faster and Better Learning for Bounding Box Regression》
Network metering - transport layer
【BiSeNet】《BiSeNet:Bilateral Segmentation Network for Real-time Semantic Segmentation》
常量指针和指针常量
图像增强的几个方法以及Matlab代码
Target detection for long tail distribution -- balanced group softmax
Summary of open3d environment errors
What if the laptop task manager is gray and unavailable
【Wing Loss】《Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks》
A brief analysis of graph pooling
【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》