kncn

[ XITE Reference Manual | XITE home ]

Name

kncn - k nearest connected neighbours noise reduction

Syntax

 #include <xite/kncn.h>

 int kncn( IBAND b1, IBAND b2, int k );

Description

kncn performs the kncn-filter for noise removal, averaging over the center pixel and k connected neighbours in the input band b1. The result appears in b2.

k, the filtering parameter, gives the number of neighbours.

Reference

 T. Lønnestad: "Connected Filters for Noise Removal"
 Proc. of 9. ICPR, Rome, 1988, 848-850.

Restrictions

b1 and b2 must both have either pixel type unsigned byte or unsigned short.

Return value

 0 => ok
 1 => Bad pixel type
 2 => Bands have different pixel types
 3 => Bad k value (less than 1)

See also

kncn(1), mbkncn(3), knn(3), mbknn(3)

Author

Tor Lønnestad, BLAB, Ifi, UiO.

Id

$Id: kncn.c,v 1.25 1997/01/10 16:04:24 svein Exp $