Photography, medical scans, satellite imagery — almost every image you process has noise: random grains that obscure the real signal. The obvious fix is blurring: average nearby pixels together and the random spikes cancel out.
The problem is that blurring does not distinguish noise from structure. A standard Gaussian blur weights neighbors purely by distance: the closer a pixel, the more it contributes. That kills noise, but it also bleeds bright pixels across dark edges, turning every sharp boundary into a soft gradient.
The bilateral filter, introduced by Carlo Tomasi and Roberto Manduchi in 1998, adds a second weight. Each neighbor's contribution is scaled not only by how close it is (the spatial Gaussian) but also by how similar its color is (the range Gaussian). Pixels on the other side of an edge are very different in intensity, so they get a tiny weight and barely influence the output. Noise, which is random and small, averages away. Edges, which represent large, consistent differences, survive intact.
The result is a filter that knows the difference between a noisy smooth region and a genuine boundary — and treats each accordingly.
Comments
Loading comments...