Table of Contents
Fetching ...

Fast Isotropic Median Filtering

Ben Weiss

TL;DR

This work tackles the challenge of fast, high-quality isotropic median filtering with circular kernels across arbitrary bit-depths and kernel shapes. It introduces the omnigram, an immutable 2D extension of compound histograms, together with an ordinal transform that yields a unique ordinal image, enabling constant-time queries for circular regions. The method processes images in tiles, computing medians via pivots and counts and then sweeping horizontally and vertically to leverage vectorization on CPU and GPU, achieving state-of-the-art performance and markedly reduced anisotropic artifacts. The results demonstrate substantial quality gains and speedups over existing square-kernel methods, with practical impact for large kernels and HDR-like data, while outlining future directions for coherence analysis, small-kernel optimization, and broader kernel shapes.

Abstract

Median filtering is a cornerstone of computational image processing. It provides an effective means of image smoothing, with minimal blurring or softening of edges, invariance to monotonic transformations such as gamma adjustment, and robustness to noise and outliers. However, known algorithms have all suffered from practical limitations: the bit depth of the image data, the size of the filter kernel, or the kernel shape itself. Square-kernel implementations tend to produce streaky cross-hatching artifacts, and nearly all known efficient algorithms are in practice limited to square kernels. We present for the first time a method that overcomes all of these limitations. Our method operates efficiently on arbitrary bit-depth data, arbitrary kernel sizes, and arbitrary convex kernel shapes, including circular shapes.

Fast Isotropic Median Filtering

TL;DR

This work tackles the challenge of fast, high-quality isotropic median filtering with circular kernels across arbitrary bit-depths and kernel shapes. It introduces the omnigram, an immutable 2D extension of compound histograms, together with an ordinal transform that yields a unique ordinal image, enabling constant-time queries for circular regions. The method processes images in tiles, computing medians via pivots and counts and then sweeping horizontally and vertically to leverage vectorization on CPU and GPU, achieving state-of-the-art performance and markedly reduced anisotropic artifacts. The results demonstrate substantial quality gains and speedups over existing square-kernel methods, with practical impact for large kernels and HDR-like data, while outlining future directions for coherence analysis, small-kernel optimization, and broader kernel shapes.

Abstract

Median filtering is a cornerstone of computational image processing. It provides an effective means of image smoothing, with minimal blurring or softening of edges, invariance to monotonic transformations such as gamma adjustment, and robustness to noise and outliers. However, known algorithms have all suffered from practical limitations: the bit depth of the image data, the size of the filter kernel, or the kernel shape itself. Square-kernel implementations tend to produce streaky cross-hatching artifacts, and nearly all known efficient algorithms are in practice limited to square kernels. We present for the first time a method that overcomes all of these limitations. Our method operates efficiently on arbitrary bit-depth data, arbitrary kernel sizes, and arbitrary convex kernel shapes, including circular shapes.

Paper Structure

This paper contains 22 sections, 5 equations, 14 figures.

Figures (14)

  • Figure 1: Median-filtering binary noise with increasingly isotropic kernel shapes. By observing the cross-hatching artifacts introduced by filtering noise with low-order polygonal kernels, the importance of using near-isotropic kernels (ideally 12-sided or circular) to obtain optimal image quality is strikingly evident.
  • Figure 2: Sliding-window method of Huang et al. 10.1109/TASSP.1979.1163188. (a) As the top left 5x5 window slides one pixel to the right, blue-shaded pixels are added to a running histogram, and yellow-shaded pixels removed. (b) The method as adapted to a 21-tap circular kernel.
  • Figure 3: Ordinal transform of Weiss 10.1145/1141911.1141918. Cardinal brightness values (left) map to their respective ordinal ranks (right), creating an "ordinal image." Duplicate cardinal values (yellow) map to consecutive ordinal values. Note that the median values in e.g. the blue squares (29 and 4, respectively) map to each other, illustrating the invariance of the filter under this transform. The lower-left array is the "reverse map" that maps ordinal results back to cardinal output values.
  • Figure 4: Comparison of the compound histogram (Weiss 10.1145/1141911.1141918) and the omnigram (our method). The compound histogram (red) covers a subset of input rows, encoding the column index of each ordinal value in those rows, or a sentinel '–' for values outside those rows. With the compound histogram, membership of a given ordinal value in an arbitrary full-height rectangle within the red strip can be determined in constant time. With the omnigram (blue), the full 2D location of each ordinal value is encoded, encompassing the entire input image. With this encoding, membership in any arbitrary image region (e.g. the blue circle) can be determined in constant time.
  • Figure 5: Ordinal image and omnigram. Binary histogram elements (right) of any ordinal image region (tinted circles, left) can be extracted in constant time by querying the omnigram (center).
  • ...and 9 more figures