我们首先来看一下bilateralFilter,双边滤波
具体查看:https://en.wikipedia.org/wiki/Bilateral_filter点击打开链接
A bilateral filter is a non-linear, edge-preserving and noise-reducing smoothing filter for images. The intensity value at each pixel in an image is replaced by a weighted average of intensity values from nearby pixels. This weight can be based on a Gaussian distribution. Crucially, the weights depend not only on Euclidean distance of pixels, but also on the radiometric differences (e.g. range differences, such as color intensity, depth distance, etc.). This preserves sharp edges by systematically looping through each pixel and adjusting weights to the adjacent pixels accordingly.
也就是说:双边滤波器是一种非线性,边缘保留和减除噪声的图像平滑滤波器。在图像的每个像素强度值处被从附近的像素强度值的加权平均来取代。这个权值可以是基于高斯分布的。关键的是,权重不仅取决于像素的欧几里得距离,而且也在辐射差异(比如,范围的差异,颜色强度,深度距离等)。这个在系统地遍历每个像素的过程中保留了锐利的边缘和相应调整相邻的像素的权重。
The bilateral filter is defined as双边滤波器的定义如下:
where the normalization term标准化的术语:
ensures that the filter preserves image energy and
- is the filtered image;过滤后的图像
- is the original input image to be filtered;原始输入图像
- are the coordinates of the current pixel to be filtered;当前正在过滤的像素的坐标
- is the window centered in ;过滤窗口的中心
- is the range kernel for smoothing differences in intensities. This function can be a Gaussian function;内核范围平滑强度的差异,这个函数是高斯函数
- is the spatial kernel for smoothing differences in coordinates. This function can be a Gaussian function;是平滑的内核空间坐标的差异,这个函数也是高斯函数
As mentioned above, the weight is assigned using the spatial closeness and the intensity difference.[1] Consider a pixel located at which needs to be denoised in image using its neighbouring pixels and one of its neighbouring pixels is located at . Then, the weight assigned for pixel to denoise the pixel