Image Processing Toolbox
  Go to function:
    Search    Help Desk 
nlfilter    Examples   See Also

Perform general sliding-neighborhood operations

Syntax

Description

B = nlfilter(A,[m n],fun) applies the function fun to each m-by-n sliding block of A. fun can be a string containing the name of a function, a string containing an expression, or an inline function object. fun should accept an m-by-n block as input, and return a scalar result:

c is the output value for the center pixel in the m-by-n block x. nlfilter calls fun for each pixel in A. nlfilter zero pads the m-by-n block at the edges, if necessary.

B = nlfilter(A,[m n],fun,P1,P2,...) passes the additional parameters P1,P2,..., to fun.

B = nlfilter(A,'indexed',...) processes A as an indexed image, padding with ones if A is of class double and zeros if A is of class uint8.

Class Support

The input image A can be of any class supported by fun. The class of B depends on the class of the output from fun.

Remarks

nlfilter can take a long time to process large images. In some cases, the colfilt function can perform the same operation much faster.

Example

This call produces the same result as calling medfilt2 with a 3-by-3 neighborhood:

See Also

blkproc, colfilt



[ Previous | Help Desk | Next ]