当前位置:网站首页>Use of OpenCV 6.4 median filter
Use of OpenCV 6.4 median filter
2022-07-02 08:08:00 【Villanelle#】
Nonlinear filter
The mean filter introduced in the previous sections 、 Gaussian filters are linear filters , That is, replace the pixel value with the weighted accumulated value of the neighborhood pixel .
This section mainly introduces nonlinear filters , It has no kernel , And convolution operation is not allowed , However, the output pixel value is also determined by identifying the neighborhood pixel value .
Commonly used nonlinear filters are Median filter , Median filter Set the current pixel and its neighborhood , Calculate the middle value of the set as the current pixel value , It is very effective in eliminating salt and pepper noise .
cv::Mat image = cv::imread("salted.bmp");
cv::Mat median;
cv::medianBlur(image, median, 5);
cv::imshow("image", image);
cv::imshow("median blur", median);



It's obvious , Median filter is very efficient in eliminating noise , It can well identify abnormal black or white pixels and then replace them , The mean filter will be greatly affected by noise .
In addition, median filter It helps to preserve the sharpness of the edge , But it will wash away the texture in the homogeneous area , It will have a good visual effect , Similar to ink style .
cv::medianBlur Use of functions
Function signature
CV_EXPORTS_W void medianBlur( InputArray src, OutputArray dst, int ksize );
- The parameters are : The input image , Output image , Filter size .
- Different effects can be achieved by modifying different filter sizes . The following figure shows changing the filter size to 9 The effect of the .

边栏推荐
- [C # note] the data in DataGridView saved in WinForm is excel and CSV
- Open3d learning notes 1 [first glimpse, file reading]
- 静态库和动态库
- 【C#笔记】winform中保存DataGridView中的数据为Excel和CSV
- 樂理基礎(簡述)
- install.img制作方式
- 图像增强的几个方法以及Matlab代码
- Open3d learning note 3 [sampling and voxelization]
- open3d学习笔记二【文件读写】
- Gensim如何冻结某些词向量进行增量训练
猜你喜欢

利用Transformer来进行目标检测和语义分割

SQLyog远程连接centos7系统下的MySQL数据库

用MLP代替掉Self-Attention

Chinese garbled code under vscade

CVPR19-Deep Stacked Hierarchical Multi-patch Network for Image Deblurring论文复现

Correction binoculaire

How to wrap qstring strings

Remplacer l'auto - attention par MLP

用MLP代替掉Self-Attention

Matlab数学建模工具
随机推荐
Summary of open3d environment errors
C语言实现XML生成解析库(XML扩展)
Comparison between setTimeout and requestanimationframe (page refresh)
Where do you find the materials for those articles that have read 10000?
【MobileNet V3】《Searching for MobileNetV3》
力扣每日一题刷题总结:链表篇(持续更新)
【MagNet】《Progressive Semantic Segmentation》
【C#笔记】winform中保存DataGridView中的数据为Excel和CSV
图像增强的几个方法以及Matlab代码
E-R画图明确内容
将恶意软件嵌入到神经网络中
用全连接层替代掉卷积 -- RepMLP
The hystrix dashboard reported an error hystrix Stream is not in the allowed list of proxy host names solution
Meta learning Brief
Media query usage
(15) Flick custom source
力扣方法总结:滑动窗口
【雙目視覺】雙目矯正
It's great to save 10000 pictures of girls
Open3D学习笔记一【初窥门径,文件读取】