Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018...

27
Acceleration of the shiftable O(1) algorithm for bilateral filtering and non-local means Kunal N. Chaudhury * June 25, 2018 Abstract A direct implementation of the bilateral filter [1] requires O(σ 2 s ) operations per pixel, where σ s is the (effective) width of the spatial kernel. A fast implementation of the bilateral filter was recently pro- posed in [19] that required O(1) operations per pixel with respect to σ s . This was done by using trigonometric functions for the range ker- nel of the bilateral filter, and by exploiting their so-called shiftability property. In particular, a fast implementation of the Gaussian bilateral filter was realized by approximating the Gaussian range kernel using raised cosines. Later, it was demonstrated in [24] that this idea could be extended to a larger class of filters, including the popular non-local means filter [2, 3]. As already observed in [19], a flip side of this ap- proach was that the run time depended on the width σ r of the range kernel. For an image with dynamic range [0,T ], the run time scaled as O(T 2 2 r ) with σ r . This made it difficult to implement narrow range kernels, particularly for images with large dynamic range. In this paper, we discuss this problem, and propose some simple steps to ac- celerate the implementation, in general, and for small σ r in particular. We provide some experimental results to demonstrate the acceleration that is achieved using these modifications. Keywords: Bilateral filter, non-local means, shiftability, constant-time algorithm, Gaussian kernel, truncation, running maximum, max filter, re- cursive filter, O(1) complexity. * Correspondence: [email protected]. 1 arXiv:1203.5128v2 [cs.CV] 7 Aug 2012

Transcript of Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018...

Page 1: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

Acceleration of the shiftable O(1) algorithm forbilateral filtering and non-local means

Kunal N. Chaudhury∗

June 25, 2018

Abstract

A direct implementation of the bilateral filter [1] requires O(σ2s)

operations per pixel, where σs is the (effective) width of the spatialkernel. A fast implementation of the bilateral filter was recently pro-posed in [19] that required O(1) operations per pixel with respect toσs. This was done by using trigonometric functions for the range ker-nel of the bilateral filter, and by exploiting their so-called shiftabilityproperty. In particular, a fast implementation of the Gaussian bilateralfilter was realized by approximating the Gaussian range kernel usingraised cosines. Later, it was demonstrated in [24] that this idea couldbe extended to a larger class of filters, including the popular non-localmeans filter [2, 3]. As already observed in [19], a flip side of this ap-proach was that the run time depended on the width σr of the rangekernel. For an image with dynamic range [0, T ], the run time scaled asO(T 2/σ2

r) with σr. This made it difficult to implement narrow rangekernels, particularly for images with large dynamic range. In thispaper, we discuss this problem, and propose some simple steps to ac-celerate the implementation, in general, and for small σr in particular.We provide some experimental results to demonstrate the accelerationthat is achieved using these modifications.

Keywords: Bilateral filter, non-local means, shiftability, constant-timealgorithm, Gaussian kernel, truncation, running maximum, max filter, re-cursive filter, O(1) complexity.

∗Correspondence: [email protected].

1

arX

iv:1

203.

5128

v2 [

cs.C

V]

7 A

ug 2

012

Page 2: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

1 Introduction

The bilateral filter is an edge-preserving diffusion filter, which was intro-duced by Tomasi et al. in [1]. The edge-preserving property comes fromthe use of a range kernel (along with the spatial kernel) that is used tocontrol the diffusion in the vicinity of edges. In this work, we will focus onthe Gaussian bilateral filter where both the spatial and range kernels areGaussian [1]. This is given by

f(x) =1

η

∫Ωgσs(x− y) gσr(f(x− y)− f(x)) f(x− y) dy (1)

whereη =

∫Ωgσs(x− y) gσr(f(x− y)− f(x)) dy.

Here, gσs(x) is the centered Gaussian distribution on the plane with varianceσ2s , and gσr(s) is the one-dimensional Gaussian distribution with varianceσ2r ; Ω is the support of gσs(x) over which the averaging takes place. We callgσs(x) and gσr(s) the spatial and the range kernel.

The range kernel is controlled by the local distribution of intensity. Sharpdiscontinuities (jumps) in intensity typically occur in the vicinity of edges.This is picked up by the range kernel, which is then used to inhibit thespatial diffusion. On the other hand, the range kernel becomes inoperativein regions with smooth variations in intensity. The spatial kernel then takesover, and the bilateral filter behaves as a standard diffusion filter. Together,the spatial and range kernels perform smoothing in homogeneous regions,while preserving edges at the same time [1].

The bilateral filter has found widespread use in several image processing,computer graphics, and computer vision applications [4, 5, 6, 8, 9]; see [10]for further applications. More recently, the bilateral filter was extendedby Baudes et al. [2] in the form of the non-local means filter, where thesimilarity between pixels is measured using patches centered around thepixel.

1.1 Fast bilater filter

The direct implementation of (1) is computationally intensive, especiallywhen σs is large (σr has no effect on the run time in this case). In particular,the direct implementation requires O(σ2

s) operations per pixel. This makesthe filter slow for real-time applications. Several efficient algorithms havebeen proposed in the past for implementing the filter in real time, e.g., see

2

Page 3: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

[11, 12, 15, 13, 26, 27]. In [14], Porikli demonstrated for the first time that thebilateral filter could be implemented using O(1) operations per pixel (withrespect to σs). This was done for two different settings: (a) Spatial box filterand arbitrary range filter, and (b) Arbitrary spatial filter and polynomialrange filter. The author extended (b) to the Gaussian bilateral filter in (1)by approximating gσr(s) with its Taylor polynomial. The run time of thisapproximation was linear in the order of the polynomial. The problem withTaylor polynomials, however, is that they provide good approximations ofgσr(s) only locally around the origin. In particular, they have the followingdrawbacks:

• Taylor polynomials are not guaranteed to be positive and monotonicaway from the origin, where the approximation is poor. Moreover,they tend to blow up at the tails.

• It is difficult to approximate gσr(s) using the Taylor expansion whenσr is small. In particular, a large order polynomial is required to geta good approximation of a narrow Gaussian, and this considerablyincreases the run time of the algorithm.

The first of these problems was addressed in [19]. In this paper, the au-thors observed that it is important that the kernel used to approximate gσr(s)be positive, monotonic, and symmetric. While it is easy to ensure symmetry,the other two properties are hard to enforce using Taylor approximations.It was noticed that, in the absence of these properties, the bilateral filter in[14] created strange artifacts in the processed image (cf. Figure 3 in [19]).The authors proposed to fix this problem using the family of raised cosines,namely, functions of the form

φ(s) =[

cos( πs

2T

) ]N(−T ≤ s ≤ T ). (2)

Here N is the order of the kernel, which controls the width of φ(s). Thekernel can be made narrow by increasing N .

The key parameter in (2) is the quantity T . The idea here is that [cos(s)]N

is guaranteed to be positive and monotonic provided that s is restricted tothe interval [−π/2, π/2]. Note that the argument s in (2) takes on the values|f(x− y)− f(x)| as x and y varies over the image. Therefore, by letting

T = maxx

maxy∈Ω

|f(x− y)− f(x)|,

one could guarantee φ(s) to be positive and monotonic over [−T, T ]. In[19], T was simply set to the maximum dynamic range, for example, 255 for

3

Page 4: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

grayscale images. We refer the readers to Figure 2 in [19] for a comparisonof (2) and the polynomial kernels used in [14]. It was later observed in [24]that polynomials could also be used for the same purpose. The polynomialssuggested were of the form

φ(s) =

(1− s2

T 2

)N(−T ≤ s ≤ T ). (3)

1.2 Fast O(1) implementation using shiftable kernels

For completeness, we now explain how the above kernels can be usedto compute (1) using O(1) operations. As observed in [24], (2) and (3) areessentially the simplest kernels that have the so-called property of shiftability.This means that, for a given N , we can find a fixed set of basis functionsφ1(s), . . . , φN (s) and coefficients c1, . . . , cN , so that for any translation τ , wecan write

φ(s− τ) = c1(τ )φ1(s) + · · ·+ cN (τ )φN (s). (4)

The coefficients depend continuously on τ , but the basis functions haveno dependence on τ . For (2), both the basis functions and coefficients arecosines, while they are polynomials for (3). This shiftability property is atthe heart of the O(1) algorithm. Let f(x) denote the output of the Gaussianfilter gσs(x) with neighborhood Ω,

f(x) =

∫Ωgσs(x− y)f(y) dy. (5)

Note that, by replacing gσr(s) with φ(s), we can write (1) as

f(x) =1

η

[c1(f(x)) F1(x) + · · · cN (f(x)) FN (x)

], (6)

where we have set Fi(x) = f(x)φi(f(x)). Similarly, by setting Gi(x) =φi(f(x)), we can write

η = c1(f(x)) G1(x) + · · ·+ cN (f(x)) GN (x). (7)

Now, it is well-known that certain approximation of (5) can be computedusing just O(1) operations per pixel. These recursive algorithms are basedon specialized kernels, such as the box and the hat function [21, 23], and themore general class of box splines [16]. Putting all these together, we arriveat the following O(1) algorithm for approximating (1):

4

Page 5: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

1. Fix N , and approximate gσr(s) using (2) or (3).

2. For i = 1, 2, . . . , N , set up the images Fi(x) = f(x)φi(f(x)) andGi(x) = φi(f(x)), and the coefficients ci(f(x)) .

3. Use a recursive O(1) algorithm to compute each Fi(x) and Gi(x).

4. Plug these into (6) and (7) to get the filtered image.

It is clear that better approximations are obtained when N is large. Onthe other hand, the run time scales linearly with N . One key advantage ofthe above algorithm, however, is that the Fi(x) and Gi(x) can be computedin parallel. For small orders (N < 10), the serial implementation is found tobe comparable, and often better, than the state-of-the-art algorithms. Theparallel implementation, however, turns out to be much faster than thecompeting algorithms, at least for N < 50. Henceforth, we will refer to theabove algorithm as SHIFTABLE-BF, the shiftable bilateral filter.

1.3 Gaussian approximation for small σr

This brings us to the question as to whether we can always work with, say,N < 50 basis functions, in SHIFTABLE-BF? To answer this question, wemust explain in some detail step (1) of the algorithm, where we approximatethe Gaussian range kernel,

gσr(s) = exp

(− s2

2σ2r

),

on the interval [−T, T ]. This could be done either using (2),

gσr(s) = limN−→∞

[cos

(s√Nσ

)]N, (8)

or, using (3),

gσr(s) = limN−→∞

(1− s2

2Nσ2

)N. (9)

These approximations were proposed in [19, 24]. Note that, we have torescale (2) by

√N , and (3) by N , to get to the right limit. On the other

hand, to ensure positivity and monotonicity, we need to guarantee thatthe arguments of (8) and (9) are in the intervals [−π/2, π/2] and [0, 1]. Asimple calculation shows that this is the case provided that N is larger than

5

Page 6: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

N0 = 4T 2/π2σ2r = 0.405(T/σr)

2 for the former, and N0 = 0.5(T/σr)2 for the

latter. In other words, it is not sufficient to set N large – it must be at least beas large as N0. In Table 1, we give the values of N0 for different values of σrwhen T = 255. It is seen that N0 gets impracticable large for σr < 30. Thisdoes not come as a surprise since it is well-known that one requires a largenumber of trigonometric functions (or polynomials) to closely approximatea narrow Gaussian on a large interval. As pointed out earlier, this was alsoone of the problems in [14].

Table 1: The threshold N0 for different σr (T = 255).σr 5 10 20 30 40 60 80 100N0 1053 263 66 29 16 7 4 3

1.4 Present Contributions

In this paper, we address the above problem, namely that N0 grows asO(T 2/σ2

r ) with σr. In Section 2, we propose a fast algorithm for determiningT exactly. Besides cutting down N0, this is essential for determining the(local) dynamic range of a grayscale image that has been deformed, e.g.,by additive noise. Setting T = 255 in this case can lead to artifacts in theprocessed image. Next, in Section 3, we provide a simple and practicalmeans of reducing the order, which leads to quite dramatic reductions in therun time of SHIFTABLE-BF. These modifications are also applicable to theshiftable algorithms proposed in [19, 24]. Finally, in Section 4, we providesome experimental results to demonstrate the acceleration that is achievedusing these modifications. We also compare our algorithm with the Porikli’salgorithms [14], both in terms of speed and accuracy.

2 Fast algorithm for finding T

For the rest of the discussion, we work with finite-sized images (bounded Ω)on the Cartesian grid. We continue to use x and y to denote points on thegrid. The integral in (1) is simply replaced by a finite sum over Ω. We willuse the norm ‖x‖ = |x1|+|x2|, where x = (x1, x2). Without loss of generality,we assume that Ω is a square neighborhood, that is, Ω = x : ‖x‖ ≤ Rwhere, say, R = 3σs (if Ω is not rectangular, we take the smallest rectanglecontaining Ω).

6

Page 7: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

Note that, for a given σr, we can cut down N0 by using a tight estimatefor

T = maxx

max‖y‖≤R

|f(x− y)− f(x)|. (10)

The smaller the estimate, the lower is the threshold N0. The point is that theworst-case estimate T = 255 is often rather loose for grayscale images. Forexample, we give the exact values of T for a test image in Table 2, computedat different values of σs. We also give the time required to compute T .

Table 2: Exact values of T for the standard 512 × 512 Lena. Also shown isthe time needed to compute T using Matlab.

σs 1 3 5 10 15 20 30T 153 205 208 210 211 215 215

time (sec) 2.06 2.13 2.33 2.71 3.26 4.01 5.60

It is seen that the exact values of T are indeed much less than the worst-case estimate, particularly for small σs. For σs = 3, T is only about 205. Evenfor σs as large as 30, T is about 215. Consider the bilateral filter with σs = 10and σr = 10. From Table 1, N0 = 263 using T = 255. However, using theexact value T = 210, we can bring this down to 263 · (210/255)2 ≈ 178, areduction by almost 100. For smaller values of σr, this gain is even moredrastic. However, notice the time required to compute T in Table 1. Thisincreases quickly with the increase in σs (in fact, scales as O(R2)). Experi-ments show us that, for large σs, this is comparable to the time required tocompute the bilateral filter. It would thus help to have an O(1) algorithm forcomputing T . Motivated by our previous work on filtering using runningsums [16], we recently devised an algorithm that does exactly this. We laterfound that the algorithm had already been discovered two decades back ina different context [17, 18].

Our algorithm is based on the following observations. First, note thatwe can take out the modulus from (10) using symmetry.

Proposition 2.1 (Simplification).

T = maxx

[f(x)− max

‖y‖≤Rf(x− y)

]. (11)

Proof. This follows from the observations that |t| = max(t,−t), and that‖x − y‖ ≤ R is symmetric in x and y. Moreover, note that the operationthat takes two numbers a and b and returns max(a, b) is associative. Using

7

Page 8: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

associativity, we can write (10) as T = max(T+, T−), where

T+ = maxx

[f(x)− max

‖y‖≤Rf(x− y)

], (12)

and

T− = maxx

[max‖y‖≤R

f(x− y)− f(x)

], (13)

We claim that T+ = T−, so that we need not compute them separately.Indeed, suppose that the first maximum is attained at x0 and y0, that is,T+ = f(x0)− f(x0−y0). Taking x = x0−y0 and y = −y0, and noting that‖x− y‖ ≤ R, we must have

T− ≥ f(x− y)− f(x) = f(x0)− f(x0 − y0) = T+.

By an identical argument, T+ ≥ T−, and the proposition follows.

The problem is now reduced to that of computing the windowed maxi-mums in (11). A direct computation would still require O(R2) comparisons.It turns out that we can do this very fast (no matter how large is R) byexploiting the overlap between adjacent windows. This is done by adaptingthe so-called MAX-FILTER algorithm.

Proposition 2.2 (Max-Filter Algorithm). There is an O(1) algorithm for com-puting

max‖y‖≤R

f(x− y)

at every x.

This algorithm was first proposed by van Herk, and Gil and Werman[17, 18]. It is clear that since the search domain Ω is separable, it sufficesto solve the problem in one dimension. The problem in two-dimensionscan be solved simply by iterating the one-dimensional MAX-FILTER alongeach dimension. From (11), we arrive at Algorithm 1 for computing Twith O(1) operations. We note that Algorithm 1 does not actually computemax |f(x − y) − f(x)| : ‖y‖ ≤ R at every x. It only has access to thedistribution of the maximums. For completeness, we have explained theMAX-FILTER algorithm in the Appendix. For further details, we refer thereaders to [17, 18].

8

Page 9: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

−250 −200 −150 −100 −50 0 50 100 150 200 250

0

0.2

0.4

0.6

0.8

1

−250 −200 −150 −100 −50 0 50 100 150 200 250

0

0.2

0.4

0.6

0.8

1

Figure 1: Approximation of the target Gaussian gσr(s) on the interval[−255, 255] using the raised cosine φ(s) in (8). We have used σr = 10 inthis case, for which N0 = 263. Top: The solid blue line shows the targetGaussian gσr(s), and the broken red line is the raised cosine φ(s). We trun-cate φ(s) to obtain φε(s) in (16), where we used ε = 0.005. In this case,M = 111. Thus, a total of 2 ×M = 222 terms are dropped from the se-ries. The truncation φε(s) has only 42 terms. Bottom: The solid blue lineis gσr(s), and the broken red line is φε(s). Note that the quality of approx-imation is reasonably good even after discarding almost 84% terms. As aresult of the truncation, small oscillations of size ε emerge on the tails. Theapproximation around the origin is positive and monotonic.

9

Page 10: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

Algorithm 1 Fast algorithm for computing TInput: Image f(x) and R.Return: T as in (10).1. Set R as window of MAX-FILTER.2. Apply MAX-FILTER along each row of f(x); return image m(x).3. Apply MAX-FILTER along each column of m(x); return image M(x).4. Set T as the maximum of f(x)−M(x) over all x.

3 Acceleration using truncations

We have seen that, by using the exact value of T , we can bring down therun time by 10− 20%. Unfortunately, Table 1 tells us that this alone is notsufficient in the regime σr < 15. For example, N0 is of the order 103 inthe regime σr < 5. So why do we require so many terms in (8) and (9) toapproximate a narrow Gaussian? This is exactly because we are forcing φ(s)to positive and monotonic on its broad tails, where gσr(s) is close to zero.For example, consider the approximation in (8):

φ(s) =

N∑n=0

2−N(N

n

)cos

((2n−N)s√

Nσr

). (14)

By requiring N > N0, we can guarantee that (1) φ(s) is close to gσr(s), and(2) φ(s) is positive and monotonic over [−T, T ]. Note, however, that gσr(s)falls off very fast, and almost vanishes outside ±3σr. It turns out that onlya few significant terms in (14) contribute to the approximation in the ±3σrregion. The rest of the terms have a negligible contribution, and are requiredonly to force positivity at the tails.

Table 3: The threshold N0 before and after truncation, tolerance ε = 0.05(worst-case setting T = 255).

σr 3 5 8 10 12 15N0 (before) 2929 1053 413 263 184 119N0 (after) 95 77 53 43 36 29

% of terms dropped 96 92 88 85 82 77

Thanks to expression (14), it is now straightforward to determine whichare the significant terms. Note that the coefficients 2−N

(Nn

)in (14) are

positive and sum up to one. In fact, they are unimodal and closely followthe shape of the target Gaussian. The smallest coefficients are at the tails, and

10

Page 11: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

the largest coefficients are at the center. In particular, the smallest coefficientis 1/2N , while the largest one is 2−N [(N/2)!]−2N ! (assuming N to be even).For large N , the latter is approximately

√2/πN using Stirling’s formula.

Thus, asN gets large, the coefficients get smaller. What is perhaps significantis that the ratio of the smallest to the largest coefficient is (πN22N−1)−1/2,and this keeps shrinking at an exponential rate with N . On the other hand,the cosine functions (which act as the interpolating function) are alwaysbounded between [−1, 1].

The above observation suggests dropping the small terms on the tail. Inparticular, for a given tolerance ε > 0, let M = M(ε) be the smallest termfor which

M+1∑n=0

2−N(N

n

)> ε/2, (15)

and set

φε(s) =N−M∑n=M

2−N(N

n

)cos

((2n−N)s√

Nσr

). (16)

It follows that the error |φ(s)− φε(s)| is within ε for all −T ≤ s ≤ T . Notethat φε(s) is symmetric, but is no longer guaranteed to be positive on thetails, where oscillations begin to set in. However, what we can guarantee isthat the negative overshoots are within −ε. In fact, the quality of the finalapproximation turns out to be quite satisfactory. This is illustrated with anexample in Figure 1. The main point is that, in the regime σr < 15, we arenow able to bring down the order to well within 100. We list some of themin Table 3. Notice that we can drop more terms for a given accuracy as thekernel gets narrow. For σr < 5, we can drop almost 95% of the terms, whilekeeping the error within 0.5% of the peak value.

Note that (15) actually requires us to compute a large number of tailscoefficients, which are eventually not used in (16). It is thus better to estimateM when N is large. A good estimate of (15) is provided by the Chernoffbound for the binomial distribution [22], namely,

M∑n=0

2−N(N

n

)≤ exp

(−(N − 2M)2

4N

).

It can be verified the estimate is quite tight for N > 100. By setting thebound to ε/2, we get

M =1

2

(N −

√4N log(2/ε)

). (17)

11

Page 12: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

Algorithm 2 Improved SHIFTABLE-BF

Input: Image f(x), variances σ2s and σ2

r , and tolerance ε.Return: Bilateral filtered image f(x).1. Set R to some factor of σs (determined by size of spatial Gaussian).2. Input f(x) and R to Algorithm 1, and get T .3. Set N = 0.405(T/σr)

2.4. Assign M using the following rule:

(a) [σr > 40] Set M = 0.(b) [10 < σr ≤ 40] Compute M from (15), given N and ε.(c) [σr ≤ 10] Plug N and ε into (17) to get M .

5. Use N and M to specify φε(x) in (16).6. Using φε(x) as the range kernel, input f(x) to SHIFTABLE-BF to getf(x).

The final algorithm obtained by combining the proposed modificationsis given in Algorithm 2. Henceforth, we will continue to refer to this asthe SHIFTABLE-BF. The Matlab implementation of SHIFTABLE-BF can befound here [20].

4 Experiments

We now provide some results on synthetic and natural images to understandthe improvements obtained used our proposal. While all the experimentswere done on Matlab, we took the opportunity to report the run time of amultithreaded Java implementation of Algorithm 2. All experiments wererun on an Intel quad core 2.83 GHz processor.

4.1 Run time

First, we tested the speedup obtained using Algorithm 1 for computing T .We used a Matlab implementation of this algorithm [20]. It is expected thatthe run time remain roughly the same for different σs. As seen in table 4,this is indeed the case. The run time of the direct method, for the sameimage and the same settings of σs, was already provided in table 2. Notethat we have been able to cut down the time by a few orders using our fastalgorithm.

We then compared the run times of multithreaded Java implementationsof SHIFTABLE-BF proposed in [19] and its present refinement. For this, we

12

Page 13: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

Table 4: Average time required to compute the exact value of T usingAlgorithm 1. We used the standard 512× 512 Lena. See also Table 2.

σs 1 3 5 10 15 20 30Time (millisec) 70 71 73 71 70 72 71

Table 5: Comparison of the run times of the multithreaded Java implemen-tations of SHIFTABLE-BF (as in [19]) and its proposed improvement, fordifferent values of σr (fixed σs = 15). We used the test image Checker shownin Figure 2. Shown in the table are the different ε used in Algorithm 2. Weuse∞ to signify that the run time is impracticably large.

σr 5 8 10 12 15 20SHIFTABLE-BF (millisec) ∞ ∞ ∞ 2130 1280 800

Improved SHIFTABLE-BF (millisec) 880 500 350 270 250 150ε (% of peak value) 3 2 2 1 1 1

used the test image Checker shown in Fig. 2. We have used small valuesof σr, and a fixed σs = 15. The average run times are shown in Table 5.The tolerance ε used for the truncation are also given. We use a smaller ε(larger truncation) as σr gets small. Notice how we have been able to cutdown the run time by more than 70%. This is not surprising, since we havediscarded more than 85% of terms. Notice that the run times are now wellwithin 1 second. The run time of the direct implementation (which doesnot depend on σr) was around 10 seconds. The main point is that we cannow implement the filter in a reasonable amount of time for small σr, whichcould not be done previously in [19].

4.2 Accuracy

We next studied the effect of truncation. To get an idea of the noise thatis injected into the filter due to the truncation, we used the Checker image.This particular image allowed us to test both the diffusive and the edge-preserving properties of the filter at the same time. We used the settingσs = 30 and σr = 10. First, we tried the direct implementation of (1), using avery fine discretization. Then we tried Algorithm 2. The difference betweenthe two outputs is shown in Figure 3. The artifacts shown in the image areactually quite insignificant, within 10−5 times the peak value. Notice thatmost of the artifacts are around the edges. This comes from the oscillationsinduced at the tails of kernel by the truncation. To compare the filter outputs

13

Page 14: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

Figure 2: Test image Checker of size 256× 256 consisting of black (intensity 0)and white (intensity 255) squares. The bilateral filter acts as a diffusion filterin the interior of the squares, and as an edge-preserving filter close to theboundary. It preserves both the constant-intensity regions, and the jumpsacross squares.

(with and without truncation), we extracted two horizontal scan profilesfrom the respective outputs. These are shown in Figure 4. Notice that it israther hard to distinguish the two.

We then applied the filters on the standard grayscale image of Lena. Wefirst applied the direct implementation followed by Algorithm 2. In thiscase, T was computed to be 215. The difference image is shown in Figure 5.It is again seen that the small artifacts are cluttered near the edges. We havealso tried measuring the mean-squared-error (MSE) for different σr. Theresults are given in Table 6. Note that relatively larger MSEs are obtainedat small σr. This is because we are forced to use a large truncation to speedup the filter at small σr. The above results show that we can drasticallycut down the run time of filter using the proposed modifications, withoutincurring significant errors.

Table 6: The mean-squared-error (MSE) between the filter outputs beforeand after truncation. We use the Lena image, and a fixed σs = 30. Thetolerance ε is chosen as in Table 5.

σr 5 8 10 12 15 2010 log10(MSE) -9.3 -11.1 -11.8 -13.5 -13.8 -14.1

14

Page 15: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

Figure 3: The difference between the outputs of the direct (high resolution)implementation of (1), and that obtained using Algorithm 2. The test imagein Figure 2 was used as the input, and settings were σs = 30 and σr = 10.The noise created due to the truncation is actually very small – the error iswithin 10−5 times the peak value. See the comparison of scan profiles inFigure 4.

15

Page 16: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

(a) High resolution implementation.

(b) Our implementation.

Figure 4: Comparison of the respective scan profiles from the bilateral filteroutputs (cf. description in Figure 3).

Figure 5: The difference between the outputs for the image Lena (size 512×512). The settings were σs = 30 and σr = 10. The noise created due tothe truncation is within 10−4 times the peak value, and is thus practicallyinsignificant. Notice that the errors are mainly around the edges.

16

Page 17: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

4.3 Comparison with a benchmark algorithm

We next compared the performance of the improved SHIFTABLE-BF algo-rithm with those proposed in [14]. The latter algorithms are considered asbenchmark in the literature on fast bilateral filtering. Porikli proposed acouple of algorithms in [14] – one using a variable spatial filter and a poly-nomial range filter (we call this BF1), and the other using a constant spatialfilter and a variable range filter (we call this BF2). The difficulty with BF1 isthat it is rather difficult to control the width of the polynomial range filter.In particular, as was already mentioned in the introduction, it is difficultto approximate narrow Gaussian range kernels using BF1. We refer theinterested readers to the experimental results in [19], where a comparisonwas already made between BF1 and SHIFTABLE-BF. For completeness,we perform a single experiment to compare these filters when σr is small(a rather large value of σr was used in the experiments in [19]). For this,and the remaining experiments, we will consider the standard test imageof Barbara of size 512× 512. This image has several texture patterns, and iswell-suited for comparing the performance of bilateral filters with narrowrange kernels1. In particular, we consider the Gaussian bilateral filter withσs = 20 and σr = 20. The results obtained using SHIFTABLE-BF and BF1are shown in Figure 6. The error between the direct implementation of thebilateral filter and SHIFTABLE-BF was within 10−3. On the other hand,note how BF1 completely breaksdown. The reason for this was alreadymentioned in the introduction. A similar breakdown, with a larger σr, wasalso observed in Figure 3 in [19].

We next considered BF2, which does not suffer from the above problem.However, we note that BF2 cannot be used to perform Gaussian bilaterfiltering – it only works with constant spatial filters (box filters). This isbecause BF2 uses fast integral histograms, and this only works for box filters.To make the comparison even, we considered bilateral filters with constantspatial filters and Gaussian range kernels. We note SHIFTABLE-BF can betrivially modified to work with arbitrary spatial filters.

First, we compared the run times of the Matlab implementations ofSHIFTABLE-BF and BF2. The results obtained at particular settings ofσs (radius of box filter) and σr are shown in Figure 7. We see that therun time of SHIFTABLE-BF is consistently better than that of BF2. Thedifference is particularly large when σr > 10, and it closes down as σr getssmall. All these can be perfectly explained. Note that, as per the design,the computational complexity of BF2 is O(1) both with respect to σs and σr.

1we thank one of the reviewers for suggesting this example.

17

Page 18: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

(a) Output of SHIFTABLE-BF. (b) Output of Porikli’s algorithm.

Figure 6: Comparison of the bilateral filtering results obtained usingSHIFTABLE-BF and Porikli’s polynomial-kernel algorithm [14]. In bothcases, we used a Gaussian spatial filter (σs = 20) and a Gaussian range filter(σr = 20). For our algorithm, we set ε = 0.03. For Porikli’s algorithm, weused a Taylor polynomial with order comparable to that of the raised cosinekernel.

This is indeed seen to be the case from the run times. On the other hand,the computational complexity of SHIFTABLE-BF is O(1) with respect to σs(this is again clear from the plots in Figure 7). However, for a given σs, thecomplexity of the the original algorithm scales as O(1/σ2

r ). The complexity,in fact, remains roughly the same even after the proposed truncation. Thisexplains the step rise in the run time for small values of σr, as shown inFigure 7. However, the actual run time goes down substantially as a resultof the truncations (cf. Table 5). In particular, we have noticed that the worstcase run time of SHIFTABLE-BF is less than the average run time of BF2for σr as low as 3.

We note that the run time of BF2 depends on the number of bins usedfor the integral histogram. In the above experiments, we used as many binsas the grayscale levels of the image. It is thus possible to reduce the run timeby cutting down the resolution of the histogram. However, this comes at thecost of the quality of the filtered image. This lead us to compare the outputsof SHIFTABLE-BF and BF2. In Figure 8, we compared the MSEs of the twoalgorithms for different σs and σr for the image Barbara. We note that theMSE for SHIFTABLE-BF is significantly lower than BF2. The gap is around30 dB for σr > 10, and around 90 dB when σr ≤ 10. We noticed that this

18

Page 19: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

10 20 30 40 50 60 70 80 90 1000

2

4

6

8

10

12

14

σr [radius of range filter]

run

time

[sec

onds

]

SHIFTABLE−BFPorikli’s algorithm

(a) σs = 2.

10 20 30 40 50 60 70 80 90 1000

2

4

6

8

10

12

14

σr [radius of range filter]

run

time

[sec

onds

]

SHIFTABLE−BFPorikli’s algorithm

(b) σs = 6.

10 20 30 40 50 60 70 80 90 1000

2

4

6

8

10

12

14

σr [radius of range filter]

run

time

[sec

onds

]

SHIFTABLE−BFPorikli’s algorithm

(c) σs = 10.

10 20 30 40 50 60 70 80 90 1000

2

4

6

8

10

12

14

σr [radius of range filter]

run

time

[sec

onds

]

SHIFTABLE−BFPorikli’s algorithm

(d) σs = 14.

Figure 7: Comparison of the run times for different σs and σr. We compareour algorithm SHIFTABLE-BF with Porikli’s algorithm BF2 (using integralhistograms [14]). In either case, we use a constant spatial filter and a Gaus-sian range filter. For our algorithm, we set ε = 0.01. For Porikli’s algorithm,we use the full resolution (256 bin) histogram. Both the algorithms wereimplemented in Matlab.

19

Page 20: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

5 10 15 20 25 30 35−40

−20

0

20

40

60

80

σr [radius of range filter]

MSE

(dB

)

SHIFTABLE−BFPorikli’s algorithm

(a) σs = 2.

5 10 15 20 25 30 35−40

−20

0

20

40

60

80

σr [radius of range filter]

MSE

(dB

)

SHIFTABLE−BFPorikli’s algorithm

(b) σs = 6.

5 10 15 20 25 30 35−40

−20

0

20

40

60

80

σr [radius of range filter]

MSE

(dB

)

SHIFTABLE−BFPorikli’s algorithm

(c) σs = 10.

5 10 15 20 25 30 35−40

−20

0

20

40

60

80

σr [radius of range filter]

MSE

(dB

)

SHIFTABLE−BFPorikli’s algorithm

(d) σs = 14.

Figure 8: Comparison of the MSE for different σs and σr. The MSEs arecomputed between the direct implementation and SHIFTABLE-BF, andbetween the direct implementation and BF2. The parameter settings areidentical to those used in Figure 7.

20

Page 21: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

Figure 9: Dependence of order on σr. Here N and M are as defined inAlgorithm 2. The sudden jump at σr = 10 is due to the truncation rule in(17).

difference becomes even more pronounced if we use a smaller number ofbins. As expected, note that the individual MSEs do not vary much with σs.The reader will notice that the MSE of SHIFTABLE-BF suddenly drops by60 dB when σr ≤ 10. To explain this, we plot the effective order N − 2M fordifferent σr in Figure 9. We see that the order (of approximation) suddenlyjumps up when σr goes below 10, which explains the jump in the MSE inFigure 8. This is simply due to the rule (17) used in Algorithm 2

In Figure 10, the filtered outputs of the two algorithms are comparedwith the direct implementation, for a small value of σr. Note that thepointwise error between the direct implementation and SHIFTABLE-BF isof the order 10−3. On the other hand, the corresponding error between thedirect implementation and BF2 is substantial, a few orders larger than thatfor SHIFTABLE-BF. This explains the large gap between the MSEs in Figure8.

We close this section by commenting on the memory usage of SHIFTABLE-BFand BF2. The former requires us to compute and store a total of 2(2N −M)images, while the latter requires us to store a histogram with B bins perpixel (equivalent of B images). It is clear from Figure 9 that even for a half-resolution histogram (B = 128) and for σr > 10, the memory requirementof BF2 is comparable to that of SHIFTABLE-BF. For smaller values of σr,SHIFTABLE-BF clearly requires more memory than BF2.

21

Page 22: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

(a) Test image Barbara (size 512× 512). (b) Bilateral filter output (direct implementa-tion).

−4

−3

−2

−1

0

1

2x 10−3

(c) Error between (b) and our method.

−8

−6

−4

−2

0

2

4

6

(d) Error between (b) and Porikli’s method.

Figure 10: Comparison of the results obtained using SHIFTABLE-BF withthe direct implementation (high resolution) and Porikli’s algorithm BF2. Inall three cases, we used a constant spatial filter (radius = 20) and a Gaussianrange filter (σr = 5). For SHIFTABLE-BF, we set ε = 0.01. For BF2, weused the best possible resolution (256 bin histogram). The run times of theMatlab implementations were: Direct implementation (37 seconds), BF2 (13seconds), and SHIFTABLE-BF (6 seconds).

22

Page 23: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

5 Discussion

In this paper, we proposed some simple ways of accelerating the bilateralfiltering algorithm proposed in [19]. This, in particular, opened up thepossibility of implementing the algorithm in real-time for small σr. Wenote that the problem of determining the optimal σs and σr for a givenapplication is extrinsic to our algorithm. We are only required to determinethe parameter T , which is intrinsic to our algorithm. A fast algorithm wasproposed in the paper for this purpose. However, we note that having afast algorithm does make it easier to determine the optimal parameters.In this regard, we note that Kishan et al. have recently shown how ourfast algorithm can be used to tune the parameters for image denoising,under different noise models [25, 28]. One crucial observation used in thesepapers is that the a certain unbiased estimator of the MSE can be efficientlycomputed for our fast bilater filter, using the linear expansions in (6) and(7). The “best” parameters are choosen by optimizing this MSE estimator.While this can also be done for the polynomial-based bilateral filter in [14],this trick cannot be used for other fast implementations of the bilateral filter,at least to the best of our knowledge.

Finally, we note that the ideas proposed here can also be extended to theO(1) algorithm for non-local means given in [24]. In non-local means [2],the range kernel operates on patches centered around the pixel of interest.A coarse non-local means was considered in [24], where a small patchneighborhood consisting of the pixels u1, . . . ,up (where, say, u1 = 0) wasused. In this case, the main observation was that formula for the non-localmeans can be written in terms of following sums:∫

‖y‖≤Rf(x− y)g(f(x+ u1)− f(x− y + u1), . . . , (18)

f(x+ up)− f(x− y + up)) dy,

and ∫‖y‖≤R

g(f(x+ u1)− f(x− y + u1), . . . , (19)

f(x+ up)− f(x− y + up)) dy,

where g(s1, . . . , sp) is an anisotropic Gaussian in p variables, and has adiagonal covariance. This looks very similar to (1), except that we nowhave a multivariate range kernel. By using the separability of g(s1, . . . , sp),and by approximating each Gaussian component by either (8) or (9), a O(1)

23

Page 24: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

algorithm for computing (18) and (19) was developed. We refer the readersto [24] for further details. The key consideration with this algorithm isthat the overall order scales as Np, where N is the order of the Gaussianapproximation for each component. In this case, it is thus important tokeep N as low as possible for a given covariance. After examining (18) and(19), it is clear that the interval over which the one dimensional Gaussiansneed to be approximated is [−T, T ], where T is as defined in (10). We cancompute this using Algorithm 1. Moreover, we can further reduce the orderby truncation, especially when the covariance is small. However, Np canstill be large (even for p = 3 or 4), and hence a parallel implementation mustbe used for real-time implementation.

6 Appendix : MAX-FILTER algorithm

We explain how the MAX-FILTER algorithm works in one dimension. Letf1, f2, . . . , fN be given, and we have to compute max(fi−R, . . . , fi+R) atevery interior point i. Assume R is an integer, and N is a multiple of thewindow size W = 2R + 1, say, N = pW (padding is used if this not thecase). The idea is to compute the local maximums using running maximums,similar to running sums used for local averaging [21]. The difference hereis that, unlike averaging, the max operation is not linear. This can be fixedusing “local” running maximums.

We begin by dividing f1, f2, . . . , fN into p equal partitions. The kthpartition (k = 0, 1, . . . , p− 1) is composed of f1+kW , . . . , fW+kW . For a givenpartition k, we recursively compute the two running maximums (of lengthW ), one from from the left and one from the right. Let l(k) and r(k) be theleft and right running maximums for the kth partition. The sequence l(k)

start at the left of the partition with l(k)1 = f1+kW , and is recursively given

by l(k)i = max( l

(k)i−1, fi+kW ) for i = 2, 3, . . . ,W . It ends on the right end of

the partition. On the other hand, r(k) start at the right and ends on the left:r

(k)W = fW+kW , and r(k)

W−i = max( r(k)W−i+1, fW−i+kW ) for i = 1, 2, . . . ,W − 1.

This is done for every partition to get l(0), . . . , l(p−1) and r(0), . . . , r(p−1).We now concatenate the left maximums into a single function l1, . . . , lN ,

that is, we set l = (l(0), . . . , l(p−1)). Similarly, we concatenate the rightmaximums in order, r = (r(0), . . . , r(p−1)). In practice, we just need to re-cursively compute l1, . . . , lN and r1, . . . , rN , resetting the recursion at theboundary of every partition. We now split fi−R, . . . , fi+R into two seg-ments, which either belong to the same partition or two adjacent parti-

24

Page 25: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

tions. Then, from the associativity of the max operation, it is seen thatmax(fi−R, . . . , fi+R) = max(ri−R, li+R). Note that, we need just 3 max oper-ations per point to get the result, independent of the window size R.

7 Acknowledgments

This work was partly supported by the Swiss National Science Foundationunder grant PBELP2-135867. The author thanks M. Unser and D. Sage forinteresting discussions, and the anonymous referees for their helpful com-ments and suggestions. The author also thanks A. Singer and the Programin Applied and Computational Mathematics at Princeton University forhosting him during this work.

References

[1] C. Tomasi and R. Manduchi, “Bilateral filtering for gray and color im-ages,” Proc. IEEE International Conference on Computer Vision, pp.839-846, 1998.

[2] A. Buades, B. Coll, and J.M. Morel, “A review of image denoising algo-rithms, with a new one,” Multiscale Modeling and Simulation, vol. 4,pp. 490-530, 2005.

[3] L.P. Yaroslavsky, Digital Picture Processing–An Introduction, Springer-Verlag, Berlin, 1985.

[4] E.P. Bennett, J.L. Mason, and L. McMillan, “Multispectral bilateral videofusion,” IEEE Transactions on Image Processing, vol. 16, pp. 1185-1194,2007.

[5] H. Winnemoller, S. C. Olsen, and B. Gooch, “Real-time video abstraction,”ACM Siggraph, pp. 1221-1226, 2006.

[6] R. Ramanath and W. E. Snyder, “Adaptive demosaicking,” Journal ofElectronic Imaging, vol. 12, pp. 633-642, 2003.

[7] M. Mahmoudi and G. Sapiro, “Fast Image and Video Denoising viaNonlocal Means of Similar Neighborhoods,” IEEE Signal ProcessingLetters, vol. 12, no. 12, pp. 839-842, Dec. 2005.

25

Page 26: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

[8] J. Xiao, H. Cheng, H. Sawhney, C. Rao, and M. Isnardi, “Bilateral filtering-based optical flow estimation with occlusion detection,” European Con-ference on Computer Vision, pp. 211-224, 2006.

[9] Q. Yang, L. Wang, R. Yang, H. Stewenius, and D. Nister, “Stereo match-ing with color-weighted correlation, hierarchical belief propagation andocclusion handling,” IEEE Transactions on Pattern Analysis and Ma-chine Intelligence, vol. 31, pp. 492-504, 2009.

[10] S. Paris, P. Kornprobst, J. Tumblin, and F. Durand, “Bilateral Filter-ing: Theory and Applications,” Foundations and Trends in ComputerGraphics and Vision, vol. 4, no. 1, pp. 1-73, 2009.

[11] F. Durand and J. Dorsey, “Fast bilateral filtering for the display ofhigh-dynamic-range images,” ACM Siggraph, vol. 21, pp. 257-266, 2002.

[12] B. Weiss, “Fast median and bilateral filtering,” ACM Siggraph, vol. 25,pp. 519-526, 2006.

[13] Q. Yang, K.-H. Tan, and N. Ahuja, “Real-time O(1) bilateral filtering,”IEEE Conference on Computer Vision and Pattern Recognition, pp. 557-564, 2009.

[14] F. Porikli, “Constant time O(1) bilateral filtering,” IEEE Conference onComputer Vision and Pattern Recognition, pp. 1-8, 2008.

[15] S. Paris and F. Durand, “A fast approximation of the bilateral filterusing a signal processing approach,” European Conference on ComputerVision, pp. 568-580, 2006.

[16] K. N. Chaudhury, A. M.-Barrutia, and M. Unser, “Fast space-variantelliptical filtering using box splines,” IEEE Transactions on Image Pro-cessing, vol. 19, pp. 2290-2306, 2010.

[17] M. van Herk, “A fast algorithm for local minimum and maximum filterson rectangular and octagonal kernels,” Pattern Recognition Letters, vol.13, no. 7, pp. 517-521, 1992.

[18] J. Gil and M. Werman, “Computing 2-d min, median, and max filters,”IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 15,no. 5, pp. 504-507, 1993.

[19] K. N. Chaudhury, Daniel Sage, and M. Unser, “Fast O(1) bilateralfiltering using trigonometric range kernels,” IEEE Transactions on ImageProcessing, vol. 20, no. 12, pp. 3376-3382, 2011.

26

Page 27: Kunal N. Chaudhury June 25, 2018 arXiv:1203.5128v2 [cs.CV ... · Kunal N. Chaudhury June 25, 2018 Abstract ... arXiv:1203.5128v2 [cs.CV] 7 Aug 2012. 1 Introduction The bilateral filter

[20] K. N. Chaudhury, Fast Bilateral Filter(www.mathworks.com/matlabcentral/fileexchange/36657), MATLABCentral File Exchange, retrieved May 21, 2012.

[21] P. S. Heckbert, “Filtering by repeated integration,” International Con-ference on Computer Graphics and Interactive Techniques, vol. 20, no. 4,pp. 315-321, 1986.

[22] N. Alon and J. Spencer, The Probabilistic Method, Wiley-Interscience,2000.

[23] F. C. Crow, “Summed-area tables for texture mapping,” ACM Siggraph,vol. 18, pp. 207-212, 1984.

[24] K. N. Chaudhury, “Constant-time filtering using shiftable kernels,”IEEE Signal Processing Letters, vol. 18, no. 11, pp. 651-654, 2011.

[25] H. Kishan and C. S. Seelamantula, “SURE-Fast bilateral filters,” pre-sented at IEEE International Conference on Acoustics, Speech, and Sig-nal Processing (ICASSP), 2012.

[26] B. K. Gunturk, “Fast Bilateral Filter With Arbitrary Range and DomainKernels,” IEEE Transactions on Image Processing, vol. 20, no. 9, pp.2690-2696, 2011.

[27] A. Adams, J. Baek, M. A. Davis, “Fast high-dimensional filtering usingthe permutohedral lattice,” Computer Graphics Forum, vol. 29, no. 2,pp. 753-762, 2010.

[28] H. Kishan and C. S. Seelamantula, “Optimal parameter selection forbilateral filter using Poisson unbiased risk estimate,” accepted in IEEEInternational Conference on Image Processing (ICIP), 2012.

27