Efficient 3 x 3 Median Filter Computations

This Paper presents an efficient algorithm for median filtering with a 3x3 filter kernel with only about 9 comparisons per pixel using spatial coherence between neighbouring filter computations. The basic algorithm calculates two medians in one step and reuses sorted slices of three vertical neighbouring pixels. An extension of this algorithm for 2D spatial coherence is also examined, which calculates four medians per step. Even though theoretical results would yield 5% performance increase compared to the basic algorithm, experimental results showed less significant increase or even worse performance dependent on the hardware.