mode
[ XITE Reference Manual | XITE home ]
Name
mode - noise removal and edge sharpening
Syntax
#include <xite/median.h>
int mode( IBAND input, IBAND output, int dx,
int dy );
Description
mode filters the input band into the output band
using a mode filter with window size dx x dy;
the pixel value occurring most frequently in the
window becomes the new center value. If no pixel
value occurs more than once, the original pixel
value is maintained. Even values of dx or dy are
increased by one.
Uses histogram updating when moving horizontally
from pixel to pixel.
Restrictions
input and output must have pixel type unsigned byte.
Return value
0 => ok
1 => bad pixel type input band
2 => bad pixel type output band
3 => bad dx value (less than 1 or greater than xsize)
4 => bad dy value (less than 1 or greater than ysize)
Author
Tor Lønnestad, BLAB, Ifi, UiO
Id
$Id: mode.c,v 1.23 1997/01/10 16:07:52 svein Exp $