International Journal of Computer Vision

, Volume 112, Issue 3, pp 307–318 | Cite as

Constant Time Median and Bilateral Filtering

  • Qingxiong Yang
  • Narendra Ahuja
  • Kar-Han Tan


This paper formulates both the median filter and bilateral filter as a cost volume aggregation problem whose computational complexity is independent of the filter kernel size. Unlike most of the previous works, the proposed framework results in a general bilateral filter that can have arbitrary spatial\(^{1}\) and arbitrary range filter kernels. This bilateral filter takes about 3.5 s to exactly filter a one megapixel 8-bit grayscale image on a 3.2 GHz Intel Core i7 CPU. In practice, the intensity/range and spatial domain can be downsampled to improve the efficiency. This compression can maintain very high accuracy (e.g., 40 dB) but over \(100\times \) faster.


Bilateral filtering Edge-preserving smoothing Recursive filtering 



This work was supported in part by a GRF Grant from the Research Grants Council of Hong Kong (Project No. CityU 122212) and a grant from HP lab.


  1. Adams, A., Baek, J., & Davis, A. (2010). Fast high-dimensional filtering using the permutohedral lattice. Comput. Graph. Forum, 29(2), 753–762.CrossRefGoogle Scholar
  2. Adams, A., Gelfand, N., Dolson, J., & Levoy, M. (2009). Gaussian kd-trees for fast high-dimensional filtering. ACM Trans. Graph., 28, 21:1–21:12.CrossRefGoogle Scholar
  3. Ahuja, N. (1996). A transform for multiscale image segmentation by integrated edge and region detection. PAMI, 18, 1211–1235.CrossRefGoogle Scholar
  4. Chen, J., Paris, S., & Durand, F. (2007). Real-time edge-aware image processing with the bilateral grid. In Siggraph, vol. 26.Google Scholar
  5. Davis, L. S., & Rosenfeld, A. (1978). Noise cleaning by iterated local averaging. IEEE Trans. Syst. Man, Cybernet. SMC, 8, 703–710.Google Scholar
  6. Deriche, R. (1992). Recursively implementing the gaussian and its derivatives. In ICIP (pp. 263–267).Google Scholar
  7. Durand, F., & Dorsey, J. (2002). Fast bilateral filtering for the display of high-dynamic-range images. In Siggraph vol. 21.Google Scholar
  8. Eisemann, E., & Durand, F. (2004). Flash photography enhancement via intrinsic relighting. Siggraph, 23(3), 673–678.CrossRefGoogle Scholar
  9. Elad, M. (2002). On the bilateral filter and ways to improve it. IEEE Trans. Image Process., 11(10), 1141–1151.CrossRefMathSciNetGoogle Scholar
  10. Fattal, R. (2009). Edge-avoiding wavelets and their applications. ToG, 28(3), 1–10.CrossRefGoogle Scholar
  11. Gastal, E., & Oliveira, M. (2011). Domain transform for edge-aware image and video processing. ToG, 30(4), 69:1–69:12.CrossRefGoogle Scholar
  12. He, K., Sun, J., & Tang, X. (2010). Guided image filtering. In ECCV (pp. 1–14).Google Scholar
  13. Huber, P. J., & Wiley, J. (1981) Robust statistics. New York: Wiley InterScienceGoogle Scholar
  14. Kass, M., & Solomon, J. (2010). Smoothed local histogram filters. ToG, 29(4), 100:1–100:10.Google Scholar
  15. Paris, S., & Durand, F. (2009). A fast approximation of the bilateral filter using a signal processing approach. IJCV, 81, 24–52.Google Scholar
  16. Paris, S., Kornprobst, P., Tumblin, J., & Durand, F. (2009). Bilateral filtering: Theory and applications. Found. Trends Comput. Graph. Vision, 4(1), 1–73.CrossRefGoogle Scholar
  17. Perreault, S., & Hebert, P. (2007). Median filtering in constant time. Trans. Image Process., 16, 2389–2394.CrossRefMathSciNetGoogle Scholar
  18. Petschnigg, G., Szeliski, R., Agrawala, M., Cohen, M., Hoppe, H., & Toyama, K. (2004). Digital photography with flash and no-flash image pairs. Siggraph, 23(3), 664–672.CrossRefGoogle Scholar
  19. Pham, T. Q., & van Vliet, L. J. (2005). Separable bilateral filtering for fast video preprocessing. In Proceedings of the International Conference on Multimedia and Expo.Google Scholar
  20. Porikli, F. (2008). Constant time o(1) bilateral filtering. In CVPR.Google Scholar
  21. Smith, J. O. (2007). Introduction to digital filters with audio applications. W3K Publishing.
  22. Tabb, M., & Ahuja, N. (1997). Unsupervised multiscale image segmentation by integrated edge and region detection. TIP, 6, 642–655.Google Scholar
  23. Tomasi, C., & Manduchi, R. (1998). Bilateral filtering for gray and color images. In ICCV (pp. 839–846).Google Scholar
  24. Viola, P., & Jones, M. (2001). Robust real-time face detection. In ICCV (pp. 747–750).Google Scholar
  25. Weiss, B. (2006). Fast median and bilateral filtering. In Siggraph (vol. 25, pp. 519–526).Google Scholar
  26. Yang, Q. (2012). A non-local cost aggregation method for stereo matching. In CVPR (pp. 1402–1409).Google Scholar
  27. Yang, Q. (2012). Recursive bilateral filtering. In ECCV (pp. 399–413).Google Scholar
  28. Yang, Q., Wang, S., & Ahuja, N. (2010). Real-time specular highlight removal using bilateral filtering. In ECCV (pp. 87–100).Google Scholar
  29. Yin, L., Yang, R., Gabbouj, M., & Neuvo, Y. (1996). Weighted median filters: A tutorial. IEEE Trans. Circuits Syst. II, 43(3), 157–192.CrossRefGoogle Scholar
  30. Zucker, A., Lev, S., & Rosenfeld, A. (1977). Iterative enhancement of noisy images. IEEE Trans. Syst. Man, Cybernet. SMC, 7, 435–441.CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2014

Authors and Affiliations

  1. 1.City University of Hong KongKowloon TongChina
  2. 2.University of Illinois at Urbana-ChampaignChampaignUSA
  3. 3.Hewlett-Packard LaboratoriesPalo AltoUSA

Personalised recommendations