Springer Nature is making SARS-CoV-2 and COVID-19 research free. View research | View latest news | Sign up for updates

Highly Parallelable Bidimensional Median Filter for Modern Parallel Programming Models

  • 393 Accesses

  • 8 Citations


The median filter is a non-linear filter used for removal of Salt & Pepper noise from images, where each pixel of the image is replaced by the median of its surrounding elements, which is calculated by sorting the data. The complexity of the sorting algorithms used for the median filters are \(O(n^2)\) or \(O(n)\), depending on the kernel size. These algorithms were formulated for scalar single processor computers, with few of them successfully adapted and implemented for computers with a parallel architecture. In this paper we greatly improve the results of our earlier work, in which by means of a novel sorting algorithm, based on the Complementary Cumulative Distribution function, with \(O(n)\) computational complexity and a highly parallelable structure, we presented a 2D median filter that achieved \(O(1)\) or \(O(n)\) computational complexity, depending memory constraints. The improvements are twofold: we propose a trade-off between \(O(1)\) complexity and \(O(n)\) complexity in order to improve the overall throughput; additionally we make use of the Salt & Pepper noise model to improve the image reconstruction quality with a small performance impact. The proposed algorithm have been implemented in three parallel programming models: SIMD Intel, Multicore Intel with SIMD, and SIMT (CUDA), achieving a peak throughput of 27.0, 100.1 and 91.6 megapixels per second respectively.

This is a preview of subscription content, log in to check access.

Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7


  1. 1

    AccelerEyes (2012). ArrayFire Library. http://www.accelereyes.com/products/arrayfire. Accessed 27 Sept 2012.

  2. 2

    Bovik, A. (2000). Handbook of image and video processing. New York: Academic Press.

  3. 3

    Chaudhuri, B. (1990). An efficient algorithm for running Window pel gray level ranking 2-D images. Pattern Recognition Letters, 11(2), 77–80.

  4. 4

    Chen, S., Qin, J., Xie, Y., Zhao, J., Heng, P. (2009). A fast an flexible sorting algorithm with CUDA. In 9th international conference on algorithms and architectures for parallel processing (pp. 281–290).

  5. 5

    Chen, W., Beister, M., Kyriakou, Y., Kachelries, M. (2009). High performance median filtering using commodity graphics hardware. In IEEE nuclear science symposium conference record (NSS/MIC) (pp. 4142–4147).

  6. 6

    Cline, D., White, K.B., Egbert, P.K. (2007). Fast 8-bit median filtering based con separability. In International conference on image processing (ICIP) (pp. 281–284).

  7. 7

    Cockshott, P., & Renfrew, K. (2010). SIMD programming manual for Linux and Windows. New York: Springer.

  8. 8

    Farber, R. (2011). CUDA application design and development. San Mateo: Morgan Kaufmann.

  9. 9

    Furtak, T., Amaral, J.N., Niewiadomsk, R. (2007). Using SIMD Furtak, T., Amaral, J.N., Niewiadomsk, R. (2007). Using SIMD sorting algorithms. In SPAA ’07: Proceedings of the nineteenth annual ACM symposium on parallel algorithms and architectures (pp. 348–357).

  10. 10

    Gil, J. (1993). Computing 2-D min, median and max filters. IEEE Transactions on Pattern Analysis and Machine Intelligence, 15(5), 504–507.

  11. 11

    Huang, T., Yang, G., Tang, G. (1979). A fast two-dimensional median filter algorithm. IEEE Transactions on Acoustics, Speech and Signal Processing, 27(2), 13–18.

  12. 12

    Hwang, H., & Haddad, R.A. (1995). Adaptive median filters: new algorithms and results. IEEE Transactions on Image Processing, 4(4), 499–502.

  13. 13

    Kirk, D.B., & Hwu, W.m.W. (2010). Programming massively parallel processors: A hands-on approach. San Mateo: Morgan Kaufmann.

  14. 14

    Kolte, P., Smith, R., Su, W. (1999). A fast median filter using AltiVec. In International conference on computer design (ICCD’99) (pp. 384–391).

  15. 15

    Li, Y., Peng, S., Chu, W. (2009). An efficient parallel sorting algorithm on Metacube multiprocessors. In 9th international conference on algorithms and architectures for parallel processing (pp. 372–383).

  16. 16

    MatLab (2011). medfilt2. http://www.mathworks.com/help/toolbox/images/ref/medfilt2.html. Accessed 14 Oct 2011.

  17. 17

    Perreault, S., & Hébert, P. (2007). Median filter in constant time. IEEE Transactions on Image Processing, 16(9), 2389–2394.

  18. 18

    Rauber, T., & Rünger, G. (2010). Parallel programming: For multicore and cluster systems (1st ed.). New York: Springer.

  19. 19

    Ryan, T. (2007). Modern engineering statistics (Chapter 14, p. 468). New York: Wiley-Interscience.

  20. 20

    Sánchez, R. (2011). Diseño e implementación del filtro mediano de dos dimensiones para arquitecturas simd. Bacherlor’s degree thesis, Pontifical Catholic University of Peru (PUCP), Lima, Peru.

  21. 21

    Sánchez, R. (2012). Constant complexity bidimensional median filter for parallel computing architectures. Master’s thesis, Pontifical Catholic University of Peru (PUCP), Lima, Peru.

  22. 22

    Sánchez, R., & Rodriguez, P. (2012). Bidimensional median filter for parallel computing architectures. In 37th international conference on acoustics, speech, and signal processing (ICASSP) (pp. 1549–1552).

  23. 23

    Tukey, J. (1974). Nonlinear (nonsuperimposable) methods for smoothing data. In IEEE Electronics and Aerospace Conference (EASCON), conference records (p. 673).

  24. 24

    Wang, Z., Bovik, A., Sheikh, H., Simoncelli, E. (2004). Perceptual image quality assessment: from error visibility to structura similarity. IEEE Transactions on Image Processing, 13(4), 600–612.

Download references


The authors would like to thank NVIDIA for hardware support through its CUDA Teaching Center Program.

Author information

Correspondence to Ricardo M. Sánchez.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Sánchez, R.M., Rodríguez, P.A. Highly Parallelable Bidimensional Median Filter for Modern Parallel Programming Models. J Sign Process Syst 71, 221–235 (2013). https://doi.org/10.1007/s11265-012-0715-1

Download citation


  • Nonlinear filters
  • Parallel algorithms
  • Image processing