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? [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 are reviewed in section 6. 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 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 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]. How can 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 

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  operates in the domain of f. The nor-

plex than standard nonseparable ®lters. Most importantly, malization constant (2) is replaced by

they preserve edges, as we show in section 4.

  



¡£¢ ¡ ¡¡

Spatial locality is still an essential notion. In fact, we ¤ x f f x (4)

¦ show that range ®ltering by itself merely distortsan image's ¦

color map. We then combine range and domain ®ltering, Contrary to what occurs with the closeness function  , the

and show that the combination is much more interesting. normalization for the similarity function depends on the

We denote teh combined ®ltering as bilateral ®ltering. image f. We say that the similarity function 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 intensities plays 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 photometric locality. Combined ®lteringcan

eral ®lter, images are smoothed and edges are preserved in a be described as follows:

way that is tuned to human performance. Only perceptually 

    

¡!¢"¤ ¡ ¡# ¡# ¡ ¡¡

similar colors are averaged together, and only perceptually h x ¦©¨ x f x f f x (5)

¦ visible edges are preserved. ¦

In the following section, we formalize the notion of with the normalization 

bilateral ®ltering. Section 3 analyzes range ®ltering in 

   $

¡¢  ¡ ¡ ¡#¡

isolation. Sections 4 and 5 show experiments for black- ¤ x x f f x (6)

¦ and-white and color images, respectively. Relations with ¦ previous work are discussed in section 6, and ideas for Combined domain and range ®ltering will be denoted further exploration are summarized in section 7. as bilateral ®ltering. It replaces the pixel value at x with an average of similar and nearby pixel values. In smooth 2 The Idea

regions, pixel values in a small neighborhood are similar to

A low-pass domain ®lter applied to image f x ¡ produces

¤ each other, and the normalized similarity function ¦©¨ is

an output image de®ned as follows: close to one. As a consequence, the bilateral ®lter acts es-



  

sentially as a standard domain ®lter, and averages away the

¡ ¡ ¡

h x ¡£¢¥¤§¦©¨ x f x (1) small, weakly correlated differences between pixel values

¦

¦ caused by noise. Consider now a sharp boundary between  ¡

where  x measures the geometric closeness between a dark and a bright region, as in ®gure 1 (a). When the  the neighborhood center x and a nearby point . The bold bilateral ®lter is centered, say, on a pixel on the bright side font for f and h emphasizes the fact that both input and of the boundary, the similarity function assumes values output images may be multiband. If low-pass ®ltering is to close to one for pixels on the same side, and close to zero for

preserve the dc component of low-pass signals we obtain pixels on the dark side. The similarity function is shown in

®gure 1 (b) for a %'&)(*%+& ®lter support centered two pixels

 

 ¡¢ ¡

¤ x x (2) to the right of the step in ®gure 1 (a). The normalization

¦ ¦ ¡

term ¤ x ensures that the weights for all the pixels add up

 ¡

If the ®lter is shift-invariant,  x is only a function of to one. As a result, the ®lter replaces the bright pixel at the



the vector difference x, and ¤ is constant. center by an average of the bright pixels in its vicinity, and

Range ®ltering is similarly de®ned: essentially ignores the dark pixels. Conversely, when the

®lter is centered on a dark pixel, the bright pixels are ig-

   



¡¢¥¤ ¡ ¡ ¡ ¡¡

h x ¦¨ x f f f x (3) nored instead. Thus, as shown in ®gure 1 (c), good ®ltering

¦

¦ behavior is achieved at the boundaries, thanks to the do-

 

¡ ¡¡ except that now f f x measures the photometric sim- main component of the ®lter, and crisp edges are preserved ilarity between the pixel at the neighborhood center x and at the same time, thanks to the range component.

(a) (b) (c)

¢¡¤£¦¥

¨ ¨ ©  ¨  Figure 1: (a) A 100-gray-level step perturbed by with gray levels. (b) Combined similarity weights §¦¨ © x f f x for a

 neighborhood centered two pixels to the right of the step in (a). The range component effectively suppresses the pixels on the dark side. (c) The  ¡

step in (a) after bilateral ®ltering with ¡¥ gray levels and pixels.

? ¡

2.1 Example: the Gaussian Case unbiased: if ®ltering f x ¡ produces h x , then the same ®lter

 

? ?

CB ¡CB ¡DB ¡DB

A simple and important case of bilateral ®ltering is applied to f x ¡ a yields h x a, since f a f x

   

¡(B ¡(B ¡#¡£¢ ¡ ¡#¡

shift-invariant Gaussian ®ltering, in which both the close- a ¡¢ f a f x a f f x . Of course,

 !

¡ ¡ ness function  x and the similarity function f are the range ®lter is shift-invariant as well, as can be easily Gaussian functions of the Euclidean distance between their veri®ed from expressions (3) and (4).

arguments. More speci®cally,  is radially symmetric

3 Range Versus Bilateral Filtering

&



&('*)¦+ ,- ./

0 In the previous section we combined range ®ltering with

¦%$

 ¡£¢#"

x )21 domain ®ltering to produce bilateral ®lters. We now show

where that this combination is essential. For notational simplicity,

  

 we limit our discussion to black-and-white images, but

¡!¢  ¡¢43 3  x x x

 analogous results apply to multiband images as well. The

is the Euclidean distance between and x. The similarity main point of this section is that range ®ltering by itself  function is perfectly analogous to : merely modi®es the gray map of the image it is applied to.

& This is a direct consequence of the fact that a range ®lter



'87

& + 9:+ ,/;- 9:+ ./

0>=

¦6$

¡£¢5"

x 1 has no notion of space.

! ¡

Let E be the frequency distribution of gray levels in

! ?

where ? ¡

the input image. In the discrete case, E is the gray level

! !  ! 

!

¡£¢ ¡£¢@3 3

%GHG

f f f histogram: is typically an integer between F and , and

! ¡

E is the fraction of image pixels that have a gray value

! ! !

is a suitable measure of distance between the two intensity

! ¡

of . In the continuous case, E is the fraction of

! !

values and f. In the scalar case, this may be simply the !  absolute difference of the pixel difference or, since noise image area whose gray values are between and B . increases with image intensity, an intensity-dependent ver- For notational consistency, we continue our discussion in sion of it. A particularly interesting example for the vector the continuous case, as in the previous section. case is given in section 5. Simple manipulation, omitted for lack of space, shows

that expressions (3) and (4) for the range ®lter can be com- The geometric spread A in the domain is chosen based

bined into the following: on the desired amount of low-pass ®ltering. A large A

blurs more, that is, it combines values from more distant

!LK !M !

I

A ¡ image locations. Also, if an image is scaled up or down, ¢ (7)

must be adjusted accordingly in order to obtain equivalent J 

results. Similarly, the photometric spread A in the image where

!NM !

range is set to achieve the desired amount of combination

K !M

¡(E ¡

!NM ! !

of pixel values. Loosely speaking, pixels with values much ¡¢

J

¡(E ¡ 

closer to each other than A are mixed together and values 

much more distant than A are not. If the image is ampli®ed independently of the position x. Equation (7) shows range 

or attenuated, A must be adjusted accordingly in order to ®ltering to be a simple transformation of gray levels. The

K !M

leave the results unchanged. mapping kernel ¡ is a density function, in the sense

Just as this form of domain ®ltering is shift-invariant, that it is nonnegative and has unit integral. It is equal

! ¡

the Gaussian range ®lter introduced above is insensitive to to the histogram E weighted by the similarity function

M K

overall additive changes of image intensity, and is therefore centered at and normalized to unit area. Since is formally a density function, equation (7) represents a mean. the removal of texture. Some amount of gray-level quan- We can therefore conclude with the following result: tization can be seen in ®gure 5 (b), but this is caused by the printing process, not by the ®lter. The picture ªsim- Range ®ltering merely transforms the gray map pli®cationº illustrated by ®gure 5 (b) can be useful for of the input image. The transformed gray value is data reduction without loss of overall shape features in ap-

equal to the mean of the input's histogram values plications such as image transmission, picture editing and M

around the input gray level , weighted by the manipulation, image description for retrieval. Notice that M

range similarity function centered at . the kitten's whiskers, much thinner than the ®lter's win- dow, remain crisp after ®ltering. The intensity values of It is useful to analyze the nature of this gray map trans- dark pixels are averaged together from both sides of the formation in view of our discussion of bilateral ®ltering. whisker, while the bright pixels from the whisker itself are Speci®cally, we want to show that ignored because of the range component of the ®lter. Con- Range ®ltering compresses unimodal histograms. versely, when the ®lter is centered somewhere on a whisker,

only whisker pixel values are averaged together.

M ¡

In fact, suppose that the histogram E of the input Figure 3 shows the effect of different values of the pa-

 A

image is a single-mode curve as in ®gure 2 (a), and consider rameters A and on the resulting image. Rows corre- M

an input value of located on either side of this bell curve. spond to different amounts of domain ®ltering, columns to M

Since the symmetric similarity function is centered at , different amounts of range ®ltering. When the value of the

E 

on the rising ¯ank of the histogram, the product produces range ®ltering constant A is large (100 or 300) with respect

K !M K a skewed density ¡ . On the left side of the bell is to the overall range of values in the image (1 through 254),

skewed to the right, and vice versa. Since the transformed the range component of the ®lter has little effect for small

M

I I

value is the mean of this skewed density, we have A : all pixel values in any given neighborhood have about

M

I¢¡ on the left side and on the right side. Thus, the the same weight from range ®ltering, and the domain ®lter ¯anks of the histogram are compressed together. acts as a standard Gaussian ®lter. This effect can be seen

At ®rst, the result that range ®ltering is a simple remap- in the last two columns of ®gure (3). For smaller values  ping of the gray map seems to make range ®ltering rather of the range ®lter parameter A (10 or 30), range ®ltering useless. Things are very different, however, when range ®l- dominates perceptually because it preserves edges.

tering is combined with domain ®ltering to yield bilateral

¢¤£ F However, for A , image detail that was removed by

®ltering, as shown in equations (5) and (6). In fact, consider

smaller values of A reappears. This apparently paradoxical ®rst a domain closeness function  that is constant within effect can be noticed in the last row of ®gure 3, and in

a window centered at x, and is zero elsewhere. Then, the



¢¥£ FF A ¢¦£ F particularly dramatic form for A , . This bilateral ®lter is simply a range ®lter applied to the window. image is crisper than that above it, although somewhat hazy. The ®ltered image is still the result of a local remapping This is a consequence of the gray map transformation and of the gray map, but a very interesting one, because the histogram compression results discussed in section 3. In

remapping is different at different points in the image.

¢¦£ F fact, A is a very broad Gaussian, and the bilateral For instance, the solid curve in ®gure 2 (b) shows the ®lter becomes essentially a range ®lter. Since intensity histogram of the step image of ®gure 1 (a). This histogram values are simply remapped by a range ®lter, no loss of is bimodal, and its two lobes are suf®ciently separate to detail occurs. Furthermore, since a range ®lter compresses allow us to apply the compression result above to each the image histogram, the output image appears to be hazy. lobe. The dashed line in ®gure 2 (b) shows the effect of Figure 2 (c) shows the histograms for the input image and

bilateral ®ltering on the histogram. The compression effect



¢§£ FF A ¢ & for the two output images for A , , and for

is obvious, and corresponds to the separate smoothing of



¢¨£ FHF A ¢¨£ F A , . The compression effect is obvious.

the light and dark sides, shown in ®gure 1 (c). Similar

¢ &

considerations apply when the closeness function has a Bilateral ®ltering with parameters A pixels and



¢5GF pro®le other than constant, as for instance the Gaussian A intensity values is applied to the image in ®gure 4 pro®le shown in section 2, which emphasizes points that (a) to yield the image in ®gure 4 (b). Notice that most of the ®ne texture has been ®ltered away, and yet all contours are closer to the center of the window. are as crisp as in the original image. 4 Experiments with Black-and-White Im- Figure 4 (c) shows a detail of ®gure 4 (a), and ®gure ages 4 (d) shows the corresponding ®ltered version. The two In this section we analyze the performance of bilateral onions have assumed a graphics-like appearance, and the ®lters on black-and-white images. Figure 5 (a) and 5 (b) in ®ne texture has gone. However, the overall shading is the color plates show the potential of bilateral ®ltering for preserved, because it is well within the band of the domain 1200 1400

1200 1000

1000 800

800

600

600

400 400

200 200

0 0 f −40 −20 0 20 40 60 80 100 120 140 0 50 100 150 200 250 300

(a) (b) (c)

¡ Figure 2: (a) A unimodal image histogram (solid), and the Gaussian similarity function  (dashed). Their normalized product (dotted) is skewed to

the right. (b) Histogram (solid) of image intensities for the step in ®gure 1 (a) and (dashed) for the ®ltered image in ®gure 1 (c). (c) Histogram of image



¡¤£¦¥¥  ¡ ¡ £:¥¥  ¡ £:¥ intensities for the image in ®gure 5 (a) (solid) and for the output images with H , (dashed) and with , (dotted) from ®gure 3.

®lter and is almost unaffected by the range ®lter. Also, the pink-purple band than in the original, as shown in ®gure 6 boundaries of the onions are preserved. (c). The pink-purple band, however, is not widened as it is In terms of computational cost,the bilateral ®lter is twice in the standard-blurred version of ®gure 6 (b). as expensive as a nonseparable domain ®lter of the same A much better result can be obtained with bilateral ®l- size. The range component depends nonlinearly on the tering. In fact, a bilateral ®lter allows combining the three image, and is nonseparable. A simple trick that decreases color bands appropriately, and measuring photometric dis-

computation cost considerably is to precompute all values tances between pixels in the combined space. Moreover,

!M ¡

for the similarity function . In the Gaussian case, if this combined distance can be made to correspond closely

¢ ¢

B £

the image has levels, there are % possible values for to perceived dissimilarity by using Euclidean distance in the

!$ M

, one for each possible value of the difference . CIE-Lab color space [16]. This space is based on a large body of psychophysical data concerning color-matching 5 Experiments with Color Images experiments performed by human observers. In this space, For black-and-white images, intensities between any small Euclidean distances correlate strongly with the per- two grey levels are still grey levels. As a consequence, ception of color discrepancy as experienced by an ªaverageº when smoothing black-and-white images with a standard color-normal human observer. Thus, in a sense, bilateral low-pass ®lter, intermediate levels of gray are produced ®ltering performed in the CIE-Lab color space is the most across edges, thereby producing blurred images. With color natural type of ®ltering for color images: only perceptually images, an additional complication arises from the fact that similar colors are averaged together, and only perceptu- between any two colors there are other, often rather dif- ally important edges are preserved. Figure 6 (d) shows the ferent colors. For instance, between blue and red there image resulting from bilateral smoothing of the image in are various shades of pink and purple. Thus, disturbing ®gure 6 (a). The pink band has shrunk considerably, and color bands may be produced when smoothing across color no extraneous colors appear. edges. The smoothed image does not just look blurred, Figure 7 (c) in the color plates shows the result of ®ve it also exhibits odd-looking, colored auras around objects. iterations of bilateral ®ltering of the image in ®gure 7 (a). Figure 6 (a) in the color plates shows a detail from a picture While a single iteration produces a much cleaner image with a red jacket against a blue sky. Even in this unblurred (®gure 7 (b)) than the original, and is probably suf®cient picture, a thin pink-purple line is visible, and is caused for most image processing needs, multiple iterations have by a combination of lens blurring and pixel averaging. In the effect of ¯attening the colors in an image considerably, fact, pixels along the boundary, when projected back into but withoutblurring edges. The resulting image has a much the scene, intersect both red jacket and blue sky, and the smaller color map, and the effects of bilateral ®ltering are resulting color is the pink average of red and blue. When easier to see when displayed on a printed page. Notice the smoothing, this effect is emphasized, as the broad, blurred cartoon-like appearance of ®gure 7 (c). All shadows and pink-purple area in ®gure 6 (b) shows. edges are preserved, but most of the shading is gone, and To address this dif®culty, edge-preserving smoothing no ªnewº colors are introduced by ®ltering. could be applied to the red, green, and blue components of the image separately. However, the intensity pro®les across 6 Relations with Previous Work the edge in the three color bands are in general different. The literature on edge-preserving ®ltering is vast, and Separate smoothing results in an even more pronounced we make no attempt to summarize it. An early survey can

A ¢¨£

A ¢¥&

A ¢¤£ F

   

A ¢¨£ F A ¢¥&F A ¢ £ FF A ¢¥&FHF

Figure 3: A detail from ®gure 5 (a) processed with bilateral ®lters with various range and domain parameter values.

(a) (b)

(c) (d)

Figure 4: A picture before (a) and after (b) bilateral ®ltering. (c,d) are details from (a,b). be found in [8], quantitative comparisons in [2], and more Also, analogously to what happens for domain ®ltering, recent results in [1]. In the latter paper, the notion that similarity metrics different from Gaussian can be de®ned neighboring pixels should be averaged only when they are for bilateral ®ltering as well. In addition,range ®lters can be similar enough to the central pixels is incorporated into combined with different types of domain ®lters, including

the de®nition of the so-called ªG-neighbors.º Thus, G- oriented ®lters. Perhaps even a new scale space can be 

neighbors are in a sense an extreme case of our method, in de®ned in which the range ®lter parameter A corresponds  which a pixel is either counted or it is not. Neighbors in [1] to scale. In such a space, detail is lost for increasing A , but are strictly adjacent pixels, so iteration is necessary. edges are preserved at all range scales that are below the A common technique for preserving edges during maximum image intensity value. Although bilateral ®lters smoothing is to compute the median in the ®lter's sup- are harder to analyze than domain ®lters, because of their port, rather than the mean. Examples of this approach are nonlinear nature, we hope that other researchers will ®nd [6, 9], and an important variation [3] that uses -means them as intriguing as they are to us, and will contribute to instead of medians to achieve greater robustness. their understanding. More related to our approach are weighting schemes References that essentially average values within a sliding window, but [1] T. Boult, R. A. Melter, F. Skorina, and I. Stojmenovic. G-neighbors. change the weights according to local differential [4, 15] Proc. SPIE Conf. on Vision Geometry II, 96±109, 1993. or statistical [10, 7] measures. Of these, the most closely [2] R. T. Chin and C. L. Yeh. Quantitative evaluation of some edge- related article is [10], which contains the idea of multiply- preserving noise-smoothing techniques. CVGIP, 23:67±91, 1983. ing a geometric and a photometric term in the ®lter kernel. [3] L. S. Davis and A. Rosenfeld. Noise cleaning by iterated local However, that paper uses rational functions of distance as averaging. IEEE Trans., SMC-8:705±710, 1978. weights, with a consequent slow decay rate. This forces [4] R. E. Graham. Snow-removal Ð a noise-stripping process for picture application of the ®lter to only the immediate neighbors signals. IRE Trans., IT-8:129±144, 1961. of every pixel, and mandates multiple iterations of the ®l- [5] N. Himayat and S.A. Kassam. Approximate performance analysis ter. In contrast, our bilateral ®lter uses Gaussians as a of edge preserving ®lters. IEEE Trans., SP-41(9):2764±77, 1993. way to enforce what Overton and Weimouth call ªcenter [6] T. S. Huang, G. J. Yang, and G. Y. Tang. A fast two-dimensional pixel dominance.º A single iteration drastically ªcleansº median ®ltering algorithm. IEEE Trans., ASSP-27(1):13±18, 1979. an image of noise and other small ¯uctuations, and pre- [7] J. S. Lee. Digital image enhancement and noise ®ltering by use of serves edges even when a very wide Gaussian is used for local statistics. IEEE Trans., PAMI-2(2):165±168, 1980. the domain component. Multiple iterations are still useful [8] M. Nagao and T. Matsuyama. Edge preserving smoothing. CGIP, 9:394±407, 1979. in some circumstances, as illustrated in ®gure 7 (c), but only when a cartoon-like image is desired as the output. In [9] P. M. Narendra. A separable median ®lter for smoothing. IEEE Trans., PAMI-3(1):20±29, 1981. addition, no metrics are proposed in [10] (or in any of the [10] K. J. Overton and T. E. Weymouth. A noise reducing preprocess- other papers mentioned above) for color images, and no ing algorithm. In Proc. IEEE Computer Science Conf. on Pattern analysis is given of the interaction between the range and Recognition and Image Processing, 498±507, 1979. the domain components. Our discussions in sections 3 and [11] Athanasios Papoulis. Probability, random variables, and stochastic 5 address both these issues in substantial detail. processes. McGraw-Hill, New York, 1991. [12] P. Perona and J. Malik. Scale-space and edge detection using 7 Conclusions anisotropic diffusion. IEEE Trans., PAMI-12(7):629±639, 1990. In this paper we have introduced the concept of bilateral [13] G. Ramponi. A rational edge-preserving smoother. In Proc. Int'l ®ltering for edge-preserving smoothing. The generality of Conf. on Image Processing, 1:151±154, 1995. bilateral ®ltering is analogous to that of traditional ®lter- [14] G. Sapiro and D. L. Ringach. Anisotropic diffusion of color images. ing, which we called domain ®ltering in this paper. The In Proc. SPIE, 2657:471±382, 1996. explicit enforcement of a photometric distance in the range [15] D. C. C. Wang, A. H. Vagnucci, and C. C. Li. A gradient inverse component of a bilateral ®lter makes it possible to process weighted smoothing scheme and the evaluation of its performance. color images in a perceptually appropriate fashion. CVGIP, 15:167±181, 1981. The parameters used for bilateral ®ltering in our illus- [16] G. Wyszecki and W. S. Styles. Color Science: Concepts and Meth- trative examples were to some extent arbitrary. This is ods, Quantitative Data and Formulae. Wiley, New York, NY, 1982. however a consequence of the generality of this technique. [17] L. Yin, R. Yang, M. Gabbouj, and Y. Neuvo. Weighted median ®lters: a tutorial. IEEE Trans., CAS-II-43(3):155±192, 1996. In fact, just as the parameters of domain ®lters depend on image properties and on the intended result, so do those of bilateral ®lters. Given a speci®c application, techniques for the automatic design of ®lter pro®les and parameter values may be possible. (a) (a)

(b) (b) Figure 5: A picture before (a) and after (b) bilateral ®ltering.

(a) (b) (c) Figure 7: [above] (a) A color image, and its bilaterally smoothed versions after one (b) and ®ve (c) iterations.

Figure 6: [left] (a) A detail from a picture with a red jacket against a blue sky. The thin, pink line in (a) is spread and blurred by ordinary low- pass ®ltering (b). Separate bilateral ®ltering (c) of the red, green, blue components sharpens the pink band, but does not shrink it. Combined bilateral ®ltering (d) in CIE-Lab color space shrinks the pink band, and (c) (d) introduces no spurious colors.