FAV -- Averaging (Mean) Filter

Performs AVERAGE filtering on image data. The Averaging (mean) filter smooths image data, suppressing noise.

See Also: FED, FME, FGA, FMO, FPR, FLE, FSOBEL, FPRE, FSHARP

INPUT PORTS

Input

Type:Raster
Connection:Mandatory
Minimum Layers:1
Maximum Layers:1

Contains the input raster layer to be filtered.

Mask

Type:Bitmap
Connection:Optional
Minimum Layers:0
Maximum Layers:1

Contains the bitmap layer that indicates the area under which the input raster should be processed.

OUTPUT PORT(S)

Output

Type:Raster
Connection:Optional
Minimum Layers:0
Maximum Layers:1

Contains the output layer that will receive the filtered raster, after module execution.

INPUT PARAMETERS

FAV is controlled by the following parameters:

Filter X Size (Pixels)

Name:FilterXSize
Type:Integer
Valid Values:1 <= x <= 1001
Default:3
Requirement:Mandatory

Specifies the filter size, along with parameter FilterYSize.

 FilterXSize = filter's X size in units of pixels
 FilterYSize = filter's Y size in units of lines
Notes:

Filter Y Size (Lines)

Name:FilterYSize
Type:Integer
Valid Values:3 <= x <= 1001
Default:3
Requirement:Optional

Specifies the filter size, along with parameter FilterXSize.

 FilterXSize = filter's X size in units of pixels
 FilterYSize = filter's Y size in units of lines
Notes:

DETAILS

The average filter computes the mean (average) of the grey-level values within a rectangular filter window surrounding each pixel. This has the effect of smoothing the image (suppressing noise).

The dimensions of the filter window must be odd. The minimum filter size is 1 by 3 (or 3 by 1), and the maximum filter size allowed is 1001 by 1001. The filter window does not need to be square.

A bitmap specifies the area within the input layer which will be processed. Only this area will be filtered and the rest of the image will be unchanged. If no bitmap is connected, the entire database is processed.

ALGORITHM

FAV performs spatial filtering on each individual pixel in an image using the grey-level values in a square or rectangular window surrounding each pixel. The dimensions of the filter size must be odd and can be between 1x3 or 3x1 to 1001x1001. The filter size must not exceed the database size.

All pixels are filtered. In order to filter pixels located near the edges of the image, edge pixel values are replicated to give sufficient data.

         +---------+
         |a1 a2 a3 |
         |a4 a5 a6 |     <---   Filter window 3 X 3
         |a7 a8 a9 |
         +---------+
The averaging filter calculates the sum of all pixels in the filter window, then divides by the number of pixels in the filter window:

Filtered pixel r = (a1 + a2 +....+ a9) / 9

Example of using 5x5 filter on database image of 8x8 pixels.

   Image before filtering           Image after filtering

   8 8  8 9 9 9 7 6 6 6   6 6
   8 8  8 9 9 9 7 6 6 6   6 6
       +----------------+           +----------------+
   8 8 |8 9 9 9 7 6 6 6 | 6 6       |8 8 8 8 7 7 6 6 |
   8 8 |8 9 9 7 6 6 6 6 | 6 6       |8 8 8 7 7 6 6 6 |   
   9 9 |9 8 8 6 6 6 6 6 | 6 6       |8 8 8 7 7 6 6 6 |
   9 9 |9 8 7 7 6 5 6 6 | 6 6       |8 7 7 7 6 6 6 6 |
   7 7 |7 7 7 6 6 6 6 6 | 6 6       |7 7 7 6 6 6 6 6 |
   6 6 |6 6 6 6 6 6 6 6 | 6 6       |7 7 6 6 6 6 6 6 |   
   6 6 |6 6 6 6 6 6 6 5 | 5 5       |6 6 6 6 6 6 6 6 |
   6 6 |6 6 6 6 6 6 6 6 | 6 6       |6 6 6 6 6 6 6 6 |
       +----------------+           +----------------+        
   6 6  6 6 6 6 6 6 6 6   6 6      
   6 6  6 6 6 6 6 6 6 6   6 6
For the case where the filter does not have a full window: In the "Image before filtering" on the left, the columns and scanlines outside the box represent the last image column or scanline being reused.


About PCI Help Gateway