当前位置:网站首页>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 .
边栏推荐
- 【Batch】learning notes
- OpenCV3 6.2 低通滤波器的使用
- Look for we media materials from four aspects to ensure your creative inspiration
- My VIM profile
- 最长等比子序列
- Open3d learning note 4 [surface reconstruction]
- SQL server如何卸载干净
- Several methods of image enhancement and matlab code
- Sparse matrix storage
- Global and Chinese markets for magnetic resonance imaging (MRI) transmission 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
VS Code配置问题
C language implements XML generation and parsing library (XML extension)
Eklavya -- infer the parameters of functions in binary files using neural network
简易打包工具的安装与使用
包图画法注意规范
Open3d learning note 3 [sampling and voxelization]
Replace convolution with full connection layer -- repmlp
Embedding malware into neural networks
图像增强的几个方法以及Matlab代码
【Batch】learning notes
随机推荐
My VIM profile
利用Transformer来进行目标检测和语义分割
Longest isometric subsequence
简易打包工具的安装与使用
图像增强的几个方法以及Matlab代码
力扣每日一题刷题总结:二叉树篇(持续更新)
[binocular vision] binocular correction
WCF更新服务引用报错的原因之一
【C#笔记】winform中保存DataGridView中的数据为Excel和CSV
OpenCV关于x,y坐标容易混淆的心得
Backup, recovery and repair of XFS file system
Business architecture diagram
Eklavya -- infer the parameters of functions in binary files using neural network
樂理基礎(簡述)
C语言的库函数
AR系统总结收获
SQL server如何卸载干净
It's great to save 10000 pictures of girls
Daily practice (19): print binary tree from top to bottom
Principes fondamentaux de la théorie musicale (brève introduction)