Pink 0.9

meanfilter.c File Reference

Mean filter operator. More...


Detailed Description

Mean filter operator.

Usage: meanfilter in.pgm roi.pgm niter [inhibit.pgm] out.pgm

Description: Let F be the function stored in image in.pgm. Let R be the function stored in image roi.pgm (region of interest). Let I be the function stored in image inhibit.pgm (if any). The algorithm is the following:

Repeat niter times
  G = F
  For each image point x
    If R[x] and not I[x] then
      S = G[x]; C = 1;
      For each neighbour y of x
        If R[y] then S = S + G[y]; C = C + 1;
      F[x] = S / C;
Result: F

Types supported: byte 2d, int32_t 2d, float 2d, byte 3d, int32_t 3d, float 3d

Category: signal

Author:
Marcin Janaszewski, Michel Couprie