Fast Median and Bilateral Filtering

Ben Weiss
Shell & Slate Software Corp.

Accepted for presentation at SIGGRAPH 2006

Abstract

Median filtering is a cornerstone of modern image processing, and is used extensively in smoothing and de-noising applications. The fastest commercial implementations (e.g. in Adobe® Photoshop® CS2) exhibit O(r) runtime in the radius of the filter, which limits their usefulness in realtime or resolution-independent contexts. We introduce a CPU-based, vectorizable O(log r) algorithm for median filtering, to our knowledge the most efficient yet developed. Our algorithm extends to images of any bit-depth, and can also be adapted to perform bilateral filtering. On 8-bit data [shown at right], our median filter outperforms Photoshop’s implementation by up to a factor of fifty.




Paper (PDF)
Preprint. . . .Slideshow
Videos (Quicktime)
Median filter. . . .Bilateral filter


Select Figures


Median Filter Variations. Top row: original; sharpened with Gaussian; sharpened with median (note fewer halo artifacts.)
Middle row: Filtered at 20th; 50th [median]; and 80th percentiles.
Bottom row: “High Pass” using median; bilateral smoothing filter; logarithmic bilateral filter.



16-bit Median Filter Performance.



The Bilateral Filter. From left: 8-Bit Source Image; Linear-Intensity Bilateral; Logarithmic-Intensity Bilateral.
Center matches Photoshop's Surface Blur; at right is our enhanced algorithm. Note improved lip color and hair detail.



Bilateral Filter Performance. (Comparison based on Surface Blur at threshold 16.)



"String Theory." A creative algorithm by Kai Krause, based on the Weiss Median with realtime-controllable parameters.




This work is protected by US Patent #7,010,163 and Patents Pending.
Adobe and Photoshop are registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.