[Math] Why are median filters non-separable

image processingsignal processing

I'm reading through a digital signal processing textbook, which says "It should be noted that the square two-dimensional median mask is a non-separable mask" but gives no explanation as to why this is true. I can see why mean filters are separable (a $3\times 3$ matrix of ones can come from the convolution of $[1 1 1] * [1 1 1]^T$), but why is a median filter non-separable? Specifically, why are square median filters non-separable? And does this mean that all non-square median filters are separable?

Best Answer

A median filter is non-linear, since it consists of a median function that has no equivalent sum-product form, so it cannot be separated into a product of two vectors for any length larger than 2. Doesn't matter whether it has square mask or not.

For example, mean can be formed as sum product $\frac{1}{n}\sum_{i=1}^n 1\cdot x_i$, but median requires an operator that sorts and finds the middle, which is beyond any linear algebraic operations.

Related Question