OpenCV学习笔记——图像平滑处理

1、blur 归一化滤波器
Blurs an image using the normalized box filter.
C++: void blur(InputArray src, OutputArray dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT )

Parameters:
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.  输入图像
dst – output image of the same size and type as src.  输出图像
ksize – blurring kernel size.  定义内核大小 ( Size(w,h) ,w像素宽度,h像素高度 )
anchor – anchor point; default value Point(-1,-1) means that the anchor is at the kernel center.  指定锚点位置(被平滑点), 如果是负值,取核的中心为锚点。
borderType – border mode used to extrapolate pixels outside of the image.

K = \dfrac{1}{K_{width} \cdot K_{height}} \begin{bmatrix}     1 & 1 & 1 & ... & 1 \\     1 & 1 & 1 & ... & 1 \\     . & . & . & ... & 1 \\     . & . & . & ... & 1 \\     1 & 1 & 1 & ... & 1    \end{bmatrix}

2、GaussianBlur 高斯滤波器
Blurs an image using a Gaussian filter.
C++: void GaussianBlur(InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )

Parameters:
src – input image; the image 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.  输入图像
dst – output image of the same size and type as src.  输出图像
ksize – Gaussian kernel size. ksize.width and ksize.height can differ but they both must be positive and odd. Or, they can be zero’s and then they are computed from sigma* .  定义内核的大小(需要考虑的邻域范围)。 wh 必须是正奇数,否则将使用 \sigma_{x}\sigma_{y} 参数来计算内核大小。
sigmaX – Gaussian kernel standard deviation in X direction.  x 方向标准方差, 如果是 0\sigma_{x} 使用内核大小计算得到。
sigmaY – Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height , respectively (see getGaussianKernel() for details); to fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ksize, sigmaX, and sigmaY.  y 方向标准方差, 如果是 0\sigma_{y} 使用内核大小计算得到。
borderType – pixel extrapolation method (see borderInterpolate() for details).

3、medianBlur 中值滤波器
Blurs an image using the median filter.
C++: void medianBlur(InputArray src, OutputArray dst, int ksize)

Parameters:
src – input 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be CV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U.
dst – destination array of the same size and type as src.
ksize – aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...    内核大小 (只需一个值,因为我们使用正方形窗口),比1大的奇数

4、bilateralFilter 双边滤波器
Applies the bilateral filter to an image.
C++: void bilateralFilter(InputArray src, OutputArray dst, int d, double sigmaColor, double sigmaSpace, int borderType=BORDER_DEFAULT )

Parameters:
src – Source 8-bit or floating-point, 1-channel or 3-channel image.
dst – Destination image of the same size and type as src .
d – Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace .  像素的邻域直径

sigmaColor – Filter sigma in the color space. A larger value of the parameter means that farther colors within the pixel neighborhood (see sigmaSpace ) will be mixed together, resulting in larger areas of semi-equal color.  颜色空间的标准方差
sigmaSpace – Filter sigma in the coordinate space. A larger value of the parameter means that farther pixels will influence each other as long as their colors are close enough (see sigmaColor ). When d>0 , it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is proportional to sigmaSpace .  坐标空间的标准方差(像素单位)

转载于:https://www.cnblogs.com/JJJanepp/p/5646586.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值