Proceedings of the 1998 IEEE International Conference on Computer Vision, Bombay, India
Bilateral Filtering for Gray and Color Images
C. Tomasi R. Manduchi
Computer Science Department Interactive Media Group Stanford University Apple Computer, Inc. Stanford, CA 94305 Cupertino, CA 95014 [email protected] [email protected]
Abstract we prevent averaging across edges, while still averaging Bilateral ®ltering smooths images while preserving within smooth regions? Anisotropic diffusion [12, 14] is a edges, by means of a nonlinear combination of nearby popular answer: local image variation is measured at every image values. The method is noniterative, local, and sim- point, and pixel values are averaged from neighborhoods ple. It combines gray levels or colors based on both their whose size and shape depend on local variation. Diffusion geometric closeness and their photometric similarity, and methods average over extended regions by solving partial prefers near values to distant values in both domain and differentialequations, and are therefore inherentlyiterative. range. In contrast with ®lters that operate on the three Iteration may raise issues of stability and, depending on the bands of a color image separately, a bilateral ®lter can en- computational architecture, ef®ciency. Other approaches force the perceptual metric underlying the CIE-Lab color arereviewedinsection6. space, and smooth colors and preserve edges in a way In this paper, we propose a noniterative scheme for edge that is tuned to human perception. Also, in contrast with preserving smoothing that is noniterative and simple. Al- standard ®ltering, bilateral ®ltering produces no phantom though we claims no correlation with neurophysiological colors along edges in color images, and reduces phantom observations, we point out that our scheme could be imple- colors where they appear in the original image. mented by a single layer of neuron-like devices that perform their operation once per image. 1 Introduction Furthermore, our scheme allows explicit enforcement Filtering is perhaps the most fundamental operation of of any desired notion of photometric distance. This is image processing and computer vision. In the broadest particularly important for ®ltering color images. If the sense of the term ª®ltering,º the value of the ®ltered image three bands of color images are ®ltered separately from at a given location is a function of the values of the in- one another, colors are corrupted close to image edges. In put image in a small neighborhood of the same location. In fact, different bands have different levels of contrast, and particular, Gaussian low-pass ®ltering computes a weighted they are smoothed differently. Separate smoothing perturbs average of pixel values in the neighborhood, in which, the the balance of colors, and unexpected color combinations weights decrease with distance from the neighborhood cen- appear. Bilateral ®lters, on the other hand, can operate on ter. Although formal and quantitative explanations of this the three bands at once, and can be told explicitly, so to weight fall-off can be given [11], the intuitionis that images speak, which colors are similar and which are not. Only typically vary slowly over space, so near pixels are likely perceptually similar colors are then averaged together, and to have similar values, and it is therefore appropriate to the artifacts mentioned above disappear. average them together. The noise values that corrupt these The idea underlying bilateral ®ltering is to do in the nearby pixels are mutually less correlated than the signal range of an image what traditional ®lters do in its domain. values, so noise is averaged away while signal is preserved. Two pixels can be close to one another, that is, occupy The assumption of slow spatial variations fails at edges, nearby spatial location, or they can be similar to one an- which are consequently blurred by low-pass ®ltering. Many other, that is, have nearby values, possibly in a perceptually efforts have been devoted to reducing this undesired effect meaningful fashion. Closeness refers to vicinity in the do-
[1,2,3,4,5,6,7,8,9,10,12,13,14,15,17].Howcan main, similarity to vicinity in the range. Traditional ®lter- ing is domain ®ltering, and enforces closeness by weighing Supported by NSF grant IRI-9506064 and DoD grants DAAH04- 94-G-0284 and DAAH04-96-1-0007, and by a gift from the Charles Lee pixel values with coef®cients that fall off with distance. Powell foundation. Similarly, we de®ne range ®ltering, which averages image s values with weights that decay with dissimilarity. Range that of a nearby point . Thus, the similarity function ®lters are nonlinear because their weights depend on image operates in the range of the image function f, while the
intensity or color. Computationally, they are no more com- closeness function c operates in the domain of f. The nor-
plex than standard nonseparable ®lters. Most importantly, malization constant (2) is replaced by
Z Z 1
they preserve edges, as we show in section 4. 1
s k = ; d :
Spatial locality is still an essential notion. In fact, we r x f f x (4) 1 show that range ®ltering by itself merely distortsan image's 1
color map. We then combine range and domain ®ltering, Contrary to what occurs with the closeness function c,the
and show that the combination is much more interesting. normalization for the similarity function s depends on the
We denote teh combined ®ltering as bilateral ®ltering. image f. We say that the similarity function s is unbiased
Since bilateral ®lters assume an explicit notion of dis- if it depends only on the difference f f x . tance in the domain and in the range of the image function, The spatial distributionof image intensitiesplays no role they can be applied to any function for which these two in range ®ltering taken by itself. Combining intensities distances can be de®ned. In particular, bilateral ®lters can from the entire image, however, makes little sense, since be applied to color images just as easily as they are applied image values far away from x ought not to affect the ®nal to black-and-white ones. The CIE-Lab color space [16] value at x. In addition, section 3 shows that range ®ltering endows the space of colors with a perceptually meaningful by itself merely changes the color map of an image, and measure of color similarity, in which short Euclidean dis- is therefore of little use. The appropriate solution is to tances correlate strongly with human color discrimination combine domain and range ®ltering, thereby enforcing both performance [16]. Thus, if we use this metric in our bilat- geometric and photometriclocality. Combined ®lteringcan
eral ®lter, images are smoothed and edges are preserved in a be described as follows:
Z Z 1
way that is tuned to human performance. Only perceptually 1