A median filter using an MN window sorts MN pixel data along each
column
in descending order to generate N data strings, each having M sorted pixel data.
The N data strings are sequentially stored in a shift register. Data strings in
different stages of the shift register are merged with one another in descending
order to generate a new sorted data string. Such sorted data strings are again
merged with each other to generate a data string having M(N-1) sorted data.
M+1 data surrounding the median value of the data string are merged with a data
string having M sorted data in descending order to generate a data string having
2M+1 sorted data. The data value at the median rank of the 2M+1 sorted data is
output as the median value of the MN image data.