Optimal O ( 1 ) Bilateral Filter with Arbitrary Spatial and Range Kernels Using Sparse Approximation

A number of acceleration schemes for speeding up the time-consuming bilateral filter have been proposed in the literature. Among these techniques, the histogram-based bilateral filter trades the flexibility for achieving O(1) computational complexity using box spatial kernel. A recent study shows that this technique can be leveraged for O(1) bilateral filter with arbitrary spatial and range kernels by linearly combining the results of multiple-box bilateral filters. However, this method requires many box bilateral filters to obtain sufficient accuracywhen approximating the bilateral filter with a large spatial kernel. In this paper, we propose approximating arbitrary spatial kernel using a fixed number of boxes. It turns out that the multiple-box spatial kernel can be applied in manyO(1) acceleration schemes in addition to the histogram-based one. Experiments on the application to the histogram-based acceleration are presented in this paper. Results show that the proposed method has better accuracy in approximating the bilateral filter with Gaussian spatial kernel, compared with the previous histogram-based methods. Furthermore, the performance of the proposed histogram-based bilateral filter is robust with respect to the parameters of the filter kernel.


Introduction
The bilateral filter is proposed by Tomasi and Manduchi in [1].Before this name, it is called SUSAN filter [2].The general idea of the bilateral filter stems from the earlier work of the neighborhood filter [3] and the sigma filter [4].The bilateral filter is a noniterative, nonlinear spatial filter which imposes both the geometric affinity and the intensity similarity when aggregating the contribution of each neighboring pixel within the spatial support.Hence the shape of the filter kernel is data adaptive, which enables the filter to preserve abrupt edges when smoothing out small variations.Such an edge-avoiding smoothing property is later demonstrated to be of much potential use in many applications in computer vision and graphics.It has become a general tool in image processing literature, where it is employed in noise cancelation [1,[5][6][7][8], high-dynamic-range tone mapping [9][10][11], image enhancement [12][13][14], and many other applications [15][16][17].
On the flip side of its convenient properties for image-and video-based applications, the direct implementation of the standard bilateral filter requires ( 2  ) operations per pixel, where   is the radius of the effective support of the spatial kernel.The computational complexity is too intensive for time-critical applications.Consequently, a plenty of studies on its simplification and acceleration can be found in the literature.Durand and Dorsey proposed a piecewise linear bilateral filter in [9].They quantize the intensity into several segments and perform FFT-based linear filtering for each segment.The final results are pooled using a linear interpolation on these linearly filtered images.The complexity of Durand's piecewise linear bilateral filter is (log   ).Pham and van Vliet [18] decomposed the 2D bilateral convolution using two 1D bilateral convolutions and reduced the complexity to (  ).Paris et al. [19] and later Chen et al. [11] generalize the idea of the piecewise linear bilateral filter by Durand et al. to form a 3-D bilateral grid.Then the bilateral filtering can be interpreted as a linear convolution of a vector-valued image.Based on an equipollent subsampling in the augmented data 2 Mathematical Problems in Engineering space, the complexity of this method is (1 + |R|/    ), where |R| denotes the number of grids of the intensity and   is the bandwidth of the range kernel.Thus the bilateral grid method runs faster with larger spatial kernel.Weiss [20] develops an (log   ) algorithm for local histogram calculation, which is later used to derive an (log   ) bilateral filter with box spatial kernel.Porikli [21] proposes an  (1) box bilateral filter by virtue of the (1) integral histogram [22].Porikli [21] and Yang et al. [23] and later Chaudhury et al. [24,25] suggest the use of some series of the intensity to approximate arbitrary range kernel and employ (1) algorithms to efficiently compute the spatial filtering for each term of the series.
Based on Porikli's (1) single-box bilateral filter proposed in [21], Gunturk proposes an (1) bilateral filter with arbitrary spatial and range kernels by linearly combining multiple single-box bilateral filters [26].The accuracy can be improved compared with the single-box bilateral filter in approximating the bilateral filter with arbitrary spatial kernel.However, when the radius of the effective spatial support is large, a large number of single-box bilateral filters are required to guarantee the accuracy.Furthermore, no instruction for the selection over all the possible box spatial kernels is presented when the number of single-box bilateral filter is limited.Consequently, Gunturk's method does not produce sufficiently good approximation with only a few additional single-box bilateral filters when the spatial kernel is large.More details about the limitations of Gunturk's method are shown in the following text.
In this paper, we focus our attention on approximating arbitrary spatial kernel with a fixed number of boxes.With this constraint, the MSE-based optimization becomes a wellknown sparse representation problem.We then employ the Batch-OMP method published recently in [27] to solve the problem for the radiuses and the coefficients of the boxes.In addition to the application to the histogram-based bilateral filter, the proposed method can be employed in other acceleration schemes by substituting the spatial filtering with a fixed times of box filtering.Hence a number of (1) bilateral filters are produced.Afterwards, the application to the histogrambased bilateral filter is discussed with some representative experiments.Results show that the proposed histogrambased bilateral filter is robust and sufficiently accurate over a large range of the size of the spatial kernel and outperforms the other congeneric methods in both the accuracy and the robustness.
The rest of this paper is arranged as follows.Brief descriptions of the original bilateral filter and its acceleration schemes are provided in Section 2, where the previous accelerations are categorized into several types and analyzed, respectively.Then in Section 3, the proposed method for approximating arbitrary spatial kernel with a fixed number of boxes is deduced in detail.The application to some popular acceleration schemes is also provided in this section.Afterwards, the application to the histogram-based bilateral filter is tested in Section 4, together with some comparisons with the previous histogram-based methods.Finally, the conclusions are drawn in Section 5, followed by some further discussions.

Related Works
The bilateral filter is proposed by Tomasi and Manduchi in [1].It is a normalized convolution in which the contribution of a neighboring pixel depends on both the geometric distance and the intensity difference with regard to the center pixel.Generally, arbitrary kernels can be applied to both the spatial and range filtering to measure the affinity between one pixel and its neighbors.The discrete form of the bilateral filter with arbitrary spatial and range kernels can be formulated as follows: where V and  are, respectively, the original image and the filtered image and (x) denotes the effective spatial support of the filtering kernel, which is centered at x.   and   are, respectively, the spatial and range kernels.The original bilateral filter employs Gaussian kernels for both the spatial and range filtering, which provides intuitive control over the similarity measure with the variances, respectively, for these two kernels.However, the brute-force implementation of the Gaussian bilateral filter is rather time consuming and is thus too slow for real-time applications.Consequently, many research papers have been devoted to accelerating the computation of the bilateral filter, and many publications can be found during the past decade.
2.1.Kernel Separation.Pham and Vliet proposed a method to approximate the 2-D data-adaptive convolution using two 1-D data-adaptive convolutions [18].The computational complexity is reduced from ( 2  ) operations per pixel to (  ) operations per pixel, where   denotes the radius of the effective spatial support.This method performs well in regions with simple structure.However, it does not produce satisfactory results in textured regions.

Piecewise Linear Approximation. Durand and Dorsey
proposed a piecewise linear approximation of the bilateral filter in [9].The authors first quantize the original intensity into several segments.Then for each segment   , a rangeweighted image pair (  ,   ) is calculated.Afterwards, a linearly filtered result   for each   is generated by linear filtering with the corresponding range-weighted image pair, which can be formulated as follows: where   (y) =   (  − V(y)) and   (y) =   (y)V(y).Then the final result is obtained by linearly interpolating between two closest filtered images; that is, for V(x) ∈ [  ,  +1 ], the filtered output at x is given as follows: The computational complexity is dramatically reduced since the implementation requires only (log   ) operations per pixel using fast Fourier transform (FFT) to compute each   .It is further accelerated by performing a subsampling in the spatial domain.
Recently, based on Durand's formulation, Yang et al. [23] employed Deriche's recursive approximation of Gaussian kernel [28] to calculate the spatial filtering, which can be implemented in constant time and can be realized in real time in some graphic processing units (GPU).

3-D Bilateral Grid
Manipulations.The piecewise linear bilateral filter is later generalized and further accelerated by Paris et al. in [19].The authors express the filtering in a higherdimensional space where another dimension for the intensity is added to the original spatial dimensions.Then the bilateral filtering can be expressed as simple linear convolutions with a vector-valued image in this augmented space, followed by a point-by-point division.With the new representation of the data, simple criteria are derived for subsampling the data to achieve significant acceleration of the bilateral filter.With the same computational time, this method is more accurate than the piecewise linear bilateral filter by Durand and Dorsey in [9].
Built upon the technique by Paris et al. in [19], Chen et al. [11] extend the higher-dimensional approach and introduce a new compact data structure-the bilateral grid.This enables a variety of fast edge-preserving image processing applications.The authors parallelize the bilateral-grid algorithm in modern graphics hardware with graphic processing units (GPU).The GPU-based implementation is two orders of magnitude faster than the equivalent CPU-based implementations.This enables the real-time edge-preserving manipulations on high-definition images.The authors demonstrate the use of the bilateral-grid method on a variety of applications including image editing, high-dynamic-range tone mapping, and image enhancement.
The computational complexity of the bilateral-grid methods is (1 + |R|/    ) operations per pixel, where R is the dynamic range of the intensity and |R| is the number of grids occupied by the range dimension.This results in a paradoxical property that the algorithm proceeds faster when the size of the spatial kernel is larger, due to larger subsampling rate.However, the exact output is dependent on the phase of subsampling.Furthermore, the operations with small   and   require fine subsampling.This requires larger memory and more computation time.Furthermore, the aggregation of the final result relies on a trilinear interpolation among the results on the grids.Better accuracy can be obtained using higher-order interpolations.Consequently, there is a tradeoff between the quality and the computational cost using this type of bilateral filters.

Histogram-Based Approximation Using Box Spatial
Kernel.Weiss developed an iterative method to compute local histogram with (log   ) complexity in [20].He later demonstrated that such fast local histogram computation can be applied for the (log   ) bilateral filter when the spatial kernel is a uniform box.Similar to Weiss' work, Porikli proposed an (1) bilateral filter [21] based on his earlier work on (1) integral histogram [22].The bilateral filter with single-box spatial kernel is formulated as follows: where (x) denotes the box with uniform weight centered at x. Then the above formulation can be further expressed in terms of local histograms as follows: where  is the number of histogram bin,   denotes the intensity level of the th histogram bin, and  x (  ) indicates the number of pixels in the th histogram bin within the spatial neighborhood centered at x. Then the computational time is constant with (1) integral histogram technique [22].And the calculation can be further accelerated by the quantizing the intensity into a small number of histogram bins.
Based on Porikli's single-box bilateral filter, Gunturk proposed a method to approximate the bilateral filter with arbitrary spatial and range kernels using a weighted sum of multiple single-box bilateral filters [26], which can be formulated as follows: The coefficients { k } are then obtained by solving a set of linear equations which minimize the squared error between the discrete forms of This improvement provides better approximation of the bilateral filter with arbitrary spatial and range kernels by costing a little computation time compared with the singlebox bilateral filter.However, further study shows that the approximation given by ( 6) only performs well when the size of spatial kernel is relatively small.As the radius of the spatial support increases, more single-box bilateral filters should be combined to guarantee the approximation accuracy according to Gunturk's scheme.Thus the computational complexity will be unbearable for efficient applications if the size of the spatial kernel is too large.

Accelerations Based on Series Expansion of the Range
Kernel.In [21], Porikli proposes another (1) bilateral filter with arbitrary spatial kernel and Gaussian range kernel, which employs Taylor series expansion of the range kernel.Then the bilateral filtering is decomposed into a set of spatial filtering steps with the image series computed prior to the convolution.To guarantee a constant-time processing, the author proposes to subsample the separable 1D linear spatial filters to a constant number of taps asymmetrically.However, the accuracy is poor using a low order Taylor expansion when the variance of Gaussian range kernel is small.Moreover, the range weight blows up when the intensity difference is too large with respect to the variance.Hence, the decaying monotonicity for an admissible kernel is broken.
As an extension of Porikli's polynomial bilateral filter in [21], Chaudhury et al. propose a constant-time bilateral filter with trigonometric range kernels in [24].Based on the fact that the raised cosine series converges to a Gaussian, the trigonometric range kernel is applied to approximate Gaussian range kernel.The authors show that the bilateral filter using trigonometric series is more accurate than the one using Taylor series with the same number of terms.The computation time of the trigonometric bilateral filter is constant with respect to the variance of the spatial kernel.However, the complexity is (|R| 2 / 2  ) with respect to the variance of the range kernel, where |R| denotes the number of quantization levels of the intensity and   is the variance of the range kernel.Consequently, the bilateral filtering with small   will be time consuming using trigonometric range kernel.
More recently in [25], the trigonometric bilateral filter is accelerated using truncations when   is small and further extended to a larger class of data-dependent filters including the well-known nonlocal means filter.

Fast Implementation of the Bilateral Filter Using Sparse Approximation with Fixed Number of Boxes
In this paper, we propose a method to approximate arbitrary spatial kernel with multiple boxes, which can then be leveraged for the constant-time implementation of the bilateral filter with arbitrary spatial and range kernels.Let  be the radius of the spatial support of the given spatial kernel   applied in the bilateral filter.Then all the candidate boxes together form a series {  }, where  is the radius of the box   and  = 0, 1, 2, . . ., .For arbitrary   , it can be approximated using the weighted sum of all the candidate boxes, which is formulated as follows: Because of the symmetry and monotonicity of any admissible spatial kernel, it is possible to find a real positive series {  } that minimizes the following squared error: where the spatial dependency is omitted for simplicity.

Approximating Arbitrary Spatial Kernel with Fixed Number of Boxes.
For that the number of boxes is great when  is large, the computational cost will become unbearable for real-time applications.In order to handle this problem, we add a constraint that the number of boxes used in the approximation should not be larger than a preset number , such that the constrained minimization of the squared error can be further formulated as follows: min The left part of the above formulation is again the least squared error norm.And the right part is employed to limit the number of boxes used in the approximation, which denotes the number of boxes that have nonzero coefficients.
For any  ∈ [0, ], we align the center of the corresponding box with that of   and pad it with zeros up to the same size as   .Then the columns of each padded box are concatenated to form a column vector b  .We then put these column vectors together to form a matrix B of size  × ( + 1), where  = (2+1) 2 is the number of elements in   .Correspondingly, we concatenate the columns of   to form a column vector q.By defining k as a column vector containing all the coefficients   , the optimization problem given in ( 10) can be reformulated as follows: where ‖k‖ 0 is the  0 norm of the vector k, which denotes the number of non-zero elements in k.
One should be very familiar with the formulation given by (11), since it is a well-known sparse representation problem.This formulation searches the sparse representation of the signal q using the known dictionary B. This sparse approximation problem, which is known to be NP-hard, can be efficiently solved using several available techniques, including Orthogonal Matching Pursuit (OMP) [27,29,30], Basis Pursuit (BP) [31,32], and FOCUSS [33].
In this paper, we employ the efficient OMP algorithm by Rubinstein et al. in [27], namely, Batch-OMP, to solve (11).After we find out the radiuses and coefficients of the boxes corresponding to the given spatial kernel and the given number of boxes, the further computation of the bilateral filter can be given as follows: With this respect, we can benefit from the integral map technique to efficiently calculate the spatial convolution in constant time.It is worth mentioning that  in ( 10) and ( 11) is an input parameter defined by the users.For a given   , the more the number of boxes used is, the better the approximation accuracy can be achieved.But more computational time is needed for more boxes.Thus there is a tradeoff between the approximation accuracy and the computational efficiency with our method.Generally, we can find a minimum  that guarantees the acceptable quality of the approximation, which will be discussed in detail in the next section.

Application to the Histogram-Based Bilateral
Filters.Now having that an arbitrary spatial kernel is approximated with a preset number of boxes, we first exploit its use in the histogram-based bilateral filters, which is originally developed by Weiss in [20], later accelerated by Porikli in [21], and recently extended by Gunturk in [26].
Firstly, let us denote the solution of (11) using the notation {  }, which contains  non-zero coefficients for  boxes with different radiuses selected by the Batch-OMP algorithm.The subscripts 's now are not the radiuses but the indices of the selected boxes; that is,  = 1, 2, . . ., .Then the proposed bilateral filter with multiple-box spatial kernel given in (12) can be reformulated as follows: Following the single-box histogram-based bilateral filter by Weiss [20] and Porikli [21], (13) can be further formulated in terms of local histogram as follows: Prior to the filtering process, the intensity is quantized into  bins, resulting in an intensity series {  }  1 .Then the corresponding  frames of range weight {  (V(x) −   )} are calculated.Based on the work in [22], an integral histogram is established.Then  local histogram maps are calculated in constant time using the same integral histogram.Compared with the single-box bilateral filter, the proposed method requires  − 1 additional local histogram calculations, which can be efficiently obtained using the integral histogram technique.The calculations of  times of box filtering for both the numerator and dominator in ( 14) can be parallelized for more efficient implementation.

Application to the Interpolation-Based Bilateral Filters.
Since Durand's piecewise linear bilateral filter [9], Yang's extension [23], and also Paris' method [19] employ an interpolation in pooling the filtering results, we call them together the interpolation-based bilateral filters for convenience.As the origin of this type of bilateral filters, Durand's method is discussed in this paper for demonstrating the application of the proposed approximation to this type of bilateral filters.Similar adaptation can be easily made for the application to Yang's method.
Let us replace the spatial kernel   in (2) by Durand and Dorsey using the weighted sum of multiple boxes, and the calculation of   is formulated as follows: Given an image, it is first divided into a preset number of intensity segments, forming an image series {  }.Correspondingly, a range-weighted image series {  (y)} and a weight series {  (y)} are computed.Afterwards, the corresponding integral maps of these two image series are established.The filtered result   for each image segment   is computed according to (15) with (1) complexity.The final result is obtained using an interpolation, as given in (3) for an example.The running time of this bilateral filter is constant with respect to the size of the spatial kernel.

Applications to the Series-Based Bilateral
Filters.Since a convolution with spatial kernels is also involved in the seriesbased bilateral filters, the proposed sparse approximation is also possible to be applied in this type of accelerations.The detailed adaptation for the series-based bilateral filters is omitted in this paper, which can be easily derived by the readers.

Experiments and Comparisons
The proposed algorithm is implemented in MATLAB 2010b under Windows XP SP3 (32 bits), in a PC computer with Pentium Dual-Core T4200 @ 2.00 GHz each and 3 GB RAM.The proposed histogram-based bilateral filter with multiplebox spatial kernel is tested and discussed in this section.The experiments on approximating the bilateral filter with Gaussian spatial and range kernels provide the readers with a glance at the validity and the effectiveness of the proposed method.The application to other types of the acceleration of the bilateral filter can be easily implemented and evaluated under the guidance provided in the previous section.But it is not given here for saving the length of this paper.In the following text of this section, we evaluate the performance of the proposed histogram-based bilateral filter in both qualitative and quantitative aspects.
Before the evaluation, we briefly introduce the basic settings of the experiments discussed in the following text.Four standard test images are employed, which are 8 bit grayscale images of size 512 × 512, as shown in Figure 1.The numerical results given in the following texts are all produced using the standard test images, unless otherwise noticed.with Gaussian spatial and range kernels.The results are illustrated in Figure 2. As shown in Figure 2, the images in the first, third, and fifth columns are, respectively, the results of the proposed histogram-based bilateral filter, the results of Porikli's single-box bilateral filter [21], and the results of Gunturk's bilateral filter [26].The color-coded maps in the second, fourth, and sixth columns are the corresponding absolute error between the images, respectively, in the first, third, and fifth columns and the results of the standard Gaussian bilateral filter, respectively, with the same input parameters.The variances of the spatial kernels are   = 1.2, 1.8, 3.0, and 6.0, respectively, for the four rows.The variances of the range kernels are the same; that is,   = 50.
The number of boxes for the proposed method is  = 5 in producing the images in the first column.Correspondingly, the number of box bilateral filters used in Gunturk's method is  = 5 in producing the results in the fifth column.For Porikli's method, the results are obtained with optimal spatial For producing all the results shown in Figure 2,  = 16.The ranges of the absolute error maps shown here are uniformly limited to [0, 50] for better illustrating the difference of the performance of the three methods.It is shown in Figure 2 that the proposed histogram-based bilateral filter produces less error than the other two methods when varying   .Hence, better accuracy is achieved in approximating the standard bilateral filter.Note that the error maps in the fourth column show that Porikli's method with optimal box performs better than Gunturk's method when   is sufficiently large.Especially noted in the fifth column, Gunturk's method performs well with small   , but the result images gradually become darker as   increases with fixed .The performance of Gunturk's bilateral filter can be improved by increasing .However, the computational cost will increase as well.The numerical results on this experiment are also included in Tables 1 and 2. 4.2.Quantitative Evaluation.We quantitatively evaluate the proposed method in three aspects, including the running time on our system with nonoptimized MATLAB codes, the quality in approximating the standard bilateral filter according to some previously established criteria, and the minimum number of boxes to guarantee sufficient accuracy compared with the minimum number of box bilateral filters in Gunturk's method.4.2.1.Computational Efficiency.We test our method by varying values of  and  and record the running time.Experiments show that the proposed method costs about 2.36 s for a 512×512 grayscale image when  = 5 and  = 16.And every additional histogram bin costs about 0.04 s when  = 5, and every additional box costs about 0.36 s when  = 16.The local histogram calculation costs 0.34 s each time on our system, which is the most time-consuming part of the nonoptimized codes for every additional box.Further acceleration of the local histogram calculation should be done for more efficient implementation of the proposed method.
Experiments show that the running time of the proposed method is about 0.1 s more than that of Gunturk's method with  =  and  = 16.It is because the sparse approximation algorithm in the proposed method costs about 0.1 s more than the linear problem solver in Gunturk's algorithm.However, the computation of any additional box costs as much time as an additional single-box bilateral filter.As a result, the running time of the rest codes of the two algorithms is almost the same.[34] for image quality assessment with reference.It is one of the state-of-the-art methods for predicting the similarity between the test and reference images.In order to provide a more comprehensive evaluation, the FSIM is also applied for evaluating the quality of the results.Given the result images of the standard bilateral filter with different parameter settings, the PSNR and FSIM values of the results by the methods to be evaluated are calculated.
The PSNR and FSIM values on four standard test images of the proposed histogram-based method together with that of Porikli's and Gunturk's methods are, respectively, listed in Tables 1 and 2, where   = 50,  = 16, and  =  = 5.The best scores among the three methods for each individual   and each test image are shown in boldface.We can see from these two tables that our method outperforms the other two according to both criteria.And it is more robust with respect to the change of   with a fixed .Besides, Gunturk's bilateral filter performs well when   is small.However, both PSNR and FSIM values of Gunturk's method decrease quickly as   increases when  is fixed.It is because the result images become darker as   increases for a fixed , as can be  illustrated in Figure 2. Larger  is required for better quality in approximating Gaussian bilateral filter with larger   using Gunturk's method.
In order to provide a more intuitive illustration, we plot the PSNR and FSIM values on "Lena, " respectively, in Figures 3 and 4 with respect to   .As can be seen in these two figures, the proposed histogram-based bilateral filter has higher PSNR and FSIM values compared with the other two methods over a large range of   .Besides, the value of  does not affect the performance too much.As a result, only a small number of boxes are sufficient for a vast range of   using the proposed method.On the contrary, for a fixed , the scores given by both principles of Gunturk's method decay quickly as   increases.Using larger  is helpful in producing satisfactory results; however, as discussed before, the computational efficiency will be degraded as a consequence.Although small   is sufficient for most denoising applications, large   is usually required in many other applications including high-dynamic-range tone mapping [9], image enhancement [14], stereo vision [17], and dehazing [35].Consequently, the computational cost will be unbearable for efficient implementation combining a large number of single-box bilateral filters.
Furthermore, as can be seen in Figures 3 and 4, our histogram-based bilateral filter is apparently more robust than the other two methods with respect to   .On the Mathematical Problems in Engineering  For the acceptable quality threshold, it is often considered as visually undistinguishable when PSNR ≥ 40dB [21].
We experiment on a standard test image, namely, "Lena, " shown as Figure 1(c).In order to find out the minimum  for the proposed histogram-based bilateral filter and the corresponding minimum  for Gunturk's method with respect to the scale of the spatial kernel, we vary the value of   and keep other parameters unchanged.For each given   , we gradually increase both numbers and calculate the PSNR values of the results, with respect to the results of the standard Gaussian bilateral filter.Then the minimum numbers which enable the quality to exceed the acceptable threshold for both algorithms can be obtained.The minimum  and the minimum  with respect to   are shown in Figure 5.It is clearly seen that the minimum  for Gunturk's method increases as   increases.On the contrary, the minimum  for the proposed method is much smaller than the minimum  for Gunturk's method.And it is nearly constant with respect to   . = 16 and   = 50 for both methods in this experiment.It is shown that the proposed histogram-based bilateral filter is more efficient to obtain sufficient accuracy, and the performance is more robust to the change of the spatial scale of the filter.Finally, it is worth noting that, when  = 1, the proposed histogram-based bilateral filter is exactly the same as Porikli's single-box bilateral filter with optimal spatial parameter.

Conclusions and Discussions
We have presented a method for approximating arbitrary spatial kernel using a fixed number of boxes based on sparse approximation techniques.With applications to the acceleration of the bilateral filter, the proposed method can be leveraged for a broad class of constant-time bilateral filters with arbitrary spatial and range kernels.Once the parameter of the spatial kernel and the number of boxes are given, the radiuses and the coefficients of the boxes are determined by the Batch-OMP algorithm.Hence they can be computed ahead of the filtering process.The application to the histogram-based (1) bilateral filter is demonstrated in this paper, followed by a number of convictive experiments.Results tell that the proposed histogram-based bilateral filter has better accuracy compared with other histogram-based bilateral filters in approximating the standard bilateral filter.Meanwhile, the performance of the proposed histogrambased bilateral filter is robust with respect to the parameters of the filter kernels.And a small number of boxes are sufficient to achieve satisfactory accuracy for a large range of the spatial parameters.With a very little more computational cost, the accuracy of the proposed histogram-based bilateral filter is better than the previous histogram-based ones.
The proposed (1) bilateral filter with arbitrary spatial and range kernels can be parallelized for real-time implementation in GPUs.Moreover, it is possible for the proposed method to be extended to the bilateral grid.3-D cubic boxes can be used to approximate 3-D arbitrary spherical filter kernels in the augmented data space.With the proposed method, higher-dimensional manipulations are also possible in this direction.

4. 1 .
Qualitative Demonstration.For the qualitative demonstration, the proposed histogram-based method, together with Porikli's single-box bilateral filter and Gunturk's bilateral filter, is employed to approximate the standard bilateral filter

Figure 1 :Figure 2 :
Figure 1: Four standard test images used in the experiments in this paper.They are 8-bit grayscale images of size 512 × 512.

Figure 3 :
Figure3: The PSNR values of the results with respect to   .These results are calculated on "Lena" in approximating the Gaussian bilateral filter, where  = 16.

Figure 4 :
Figure4: The FSIM values of the results with respect to   .These results are calculated on "Lena" in approximating the Gaussian bilateral filter, where  = 16.

Table 1 :
Comparison of the PSNR values.

Table 2 :
Comparison of the FSIM values.
contrary, as the value of   increases, the performance of Porikli's single-box bilateral filter becomes less stable with respect to the change of   .4.2.3.Minimum Number of Box.For Gunturk's method, larger  leads to better approximation accuracy.Thus sufficient single-box bilateral filters should be combined to guarantee an acceptable accuracy.Correspondingly, as mentioned in the previous section, sufficient boxes should also be used in the proposed histogram-based bilateral filter.