rank
[ XITE Reference Manual | XITE home ]
Name
rank - noise reduction filter
Syntax
#include <xite/median.h>
int rank( IBAND input, IBAND output, int rank,
int dx, int dy );
Description
rank filters the input band into the output band
using a rank filter with window size dx*dy.
Even values of dx and dy are increased by one.
Every input pixel is replaced by the rank-th
pixel in a sorted vector containg all pixels
in the dx*dy window. rank=1 gives the min
filter, rank=dx*dy/2 gives the median filter,
and rank = dx*dy gives the max filter.
Uses histogram updating when moving horizontally
from pixel to pixel, like the method used in-
Reference
Huang, Yang and Tang: "A Fast Two-Dimensional
Median Filtering Algorithm" IEEE Trans. Ac., Speech,
and Signal Proc, Vol ASSP-27, No.1, Feb.1979.
Return value
0 => ok
1 => bad pixel type input band
2 => bad pixel type output band
3 => bad rank value (outide 1..dx*dy)
4 => bad dx value (less than 1 or greater than xsize)
5 => bad dy value (less than 1 or greater than ysize)
Author
Tor L|nnestad, BLAB, ifi, UiO
Id
$Id: rank.c,v 1.22 1997/01/10 16:09:01 svein Exp $