OpenCV图像处理 |
您所在的位置:网站首页 › 图像去模糊原理 › OpenCV图像处理 |
模糊原理
Smooth/Blur(平滑和模糊) 是图像处理中最简单和常用的操作之一
使用该操作的原因之一就是为了给图像预处理时候降低噪声 , 把噪声与周围的数值平均一下就可以平滑噪声。
使用Smooth/Blur操作背后是数学的卷积计算
卷积:通过两个函数f 和g 生成第三个函数的一种数学算子,表征函数f 与g经过翻转和平移的重叠部分的面积。 ![]()
1. 归一化盒子滤波(均值滤波) @param src input image; it can have any number of channels, which are processed independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. @param dst output image of the same size and type as src. @param ksize blurring kernel size. @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel center. @param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes @sa boxFilter, bilateralFilter, GaussianBlur, medianBlur void blur( InputArray src, OutputArray dst,Size ksize, Point anchor = Point(-1,-1),int borderType = BORDER_DEFAULT );
矩阵卷积运算的具体过程 假设有一个卷积核h,就一般为33的矩阵: 第一步,将卷积核翻转180°,也就是成为了
第三步每个元素都像这样计算出来就可以得到一个输出矩阵,就是卷积结果 …………………… |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |