Bilinear filter is a nonlinear, edge-preserving smoothing filter that is often used to smooth pictures.
It takes the weighted average of the intensity values of nearby pixels in each input image,
and it calculates the weights by the Euclidean distance between pixels and color intensity differences,
and finally obtains the picture processing effect of preserving the edges and smoothing the similar regions.
Among them, dst is the output image, src is the input image, x is the currently computed pixel, and Ω is the current filter window.
fr(x,xi)=e−21(σr∣src(xi)−src(x)∣)2
gs(x,xi)=e−21(σd∥xi−x∥)2
Among them, ∣ is the absolute value, ∥ is the Euclidean distance, σr is the color sigma parameter for smoothing intensity differences across the filter window,
and σd is the spatial sigma parameter for smoothing differences in spatial coordinates across the window.