【OpenCV4】双边滤波 bilateralFilter() 函数详解

bilateralFilter() 函数

void cv::bilateralFilter	(	InputArray 	src,
OutputArray 	dst,
int 	d,
double 	sigmaColor,
double 	sigmaSpace,
int 	borderType = BORDER_DEFAULT 
)	
  • src

输入图片需要是 8 位的数据类型,或者浮点型,可以是单通道,或者三通道。
Source 8-bit or floating-point, 1-channel or 3-channel image.

  • dst

输出图片和输入图片有相同的尺寸,数据类型,通道数
Destination image of the same size and type as src .

  • d

邻域的直径,如果是小于等于 0,则由 sigmaSpace 计算得到
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

空域滤波器的标准差。更大的值代表更大范围内的像素(颜色相近)会被相互影响。当 d 大于 0 的时候,sigmaSpace 被忽略,否则 d 由 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.

  • borderType

外延模式
border mode used to extrapolate pixels outside of the image, see BorderTypes

使用注意点

  • 双边滤波可以在去除噪声的同时,保持边缘信息相对清晰。但是,相比于大多数滤波器,双边滤波的速度是非常慢的。

  • 关于 sigma 的值: 通常为了简化,两个 sigma 的值可以设置为相等。如果这两个值都非常小,比如小于 10,则滤波器没有什么太大的效果。如果大于 150,则会有非常强的影响&

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值