FPR -- Programmable Filter (up to 33x33)

Performs programmable filtering on image data. The programmable filter averages image data according to user specified weights.

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

INPUT PORT(S)

Input

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

Contains the input image layer to be filtered.

Mask

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

Contains the input Area Mask layer, consisting of the area which should be processed. Only the area under "Mask" is written to the "Output".

OUTPUT PORT(S)

Output

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

Contains the output image layer for the filtered result.

INPUT PARAMETER(S)

FPR is controlled by the following parameters:

Text File for Filter Weights

Name:WeightFile
Type:Text
Valid Values:<filename, max. 64 characters>
Default:<none>
Requirement:Optional

Specifies the name of the Text file or text layer number containing filter weights:

 WeightFile = "filespec"        | Text File
 WeightFile = "10"              | Layer Text
NOTE: If "Matrixnn" filter matrix parameters are specified, then the WeightFile parameter is ignored.

Filter X Size (Pixels)

Name:FilterXSize
Type:Integer
Valid Values:1, 3, 5, 7, 9, ..., 33
Default:3
Requirement:Mandatory

Specifies the filter size in units of pixels:

 FilterXSize = i

Filter Y Size (Pixels)

Name:FilterYSize
Type:Integer
Valid Values:3, 5, 7, 9, 11, ..., 33
Default:3
Requirement:Mandatory

Specifies the filter size in units of pixels:

 FilterYSize = j

Matrixnn FILTER MATRIX PARAMETERS

The following group of parameters specify the filter matrix row elements:

 Matrix01 = i,j,...,p

Matrix: Row 01 (0 to 11)

Name:Matrix01
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix01" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

Matrix: Row 02 (0 to 11)

Name:Matrix02
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix02" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

Matrix: Row 03 (0 to 11)

Name:Matrix03
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix03" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

Matrix: Row 04 (0 to 11)

Name:Matrix04
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix04" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

Matrix: Row 05 (0 to 11)

Name:Matrix05
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix05" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

Matrix: Row 06 (0 to 11)

Name:Matrix06
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix06" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

Matrix: Row 07 (0 to 11)

Name:Matrix07
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix07" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

Matrix: Row 08 (0 to 11)

Name:Matrix08
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix08" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

Matrix: Row 09 (0 to 11)

Name:Matrix09
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix09" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

Matrix: Row 10 (0 to 11)

Name:Matrix10
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix10" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

Matrix: Row 11 (0 to 11)

Name:Matrix11
Type:Real
Valid Values:<see below>
Default:<none>
Requirement:Optional

Specifies the filter matrix row element "Matrix11" (see the section "Matrixnn FILTER MATRIX PARAMETERS" above for information).

DETAILS

FPR allows the user to design filters for specific requirements (e.g. Directional Filters, Laplacian Filters, etc.). The filter dimensions must be odd, and size is selectable between 1X3 and 33X33. The user must specify a matrix of real weights to be applied to each pixel within the filter window. Each row of this matrix is stored in a separate parameter: MR01, MR02, MR03, ...MR11. In order to specify a filter bigger than 11x11, the user has the option to input weights usings a text file (FLTFIL) or by text layer. Filtered pixel values is the sum of weighted values divided by sum of all filter weights. If the sum of filter weights is zero, than the weighted SUM of grey level values in the filter window is computed for the central pixel. Database input layer (DBOC) can equal input layer (DBIC).

The MASK parameter specifies the area within the input layer which will be processed. Only area under mask will be filtered and the rest of the image will be unchanged. If a single value is specified, then this value points to a bitmap layer, which define the area to be filtered. When four values are specified, these values define the x,y offsets and x,y dimensions of rectangular window within the image to be filtered. If defaulted, then entire database is processed.

ALGORITHM

The implementation of programmable filter consists of applying a set of weighting values (M),inputed by user,for each pixel(P). All pixels are filtered. In order to filter pixels located near edges of image, replicates edge pixels values to give sufficient data.

   Filtered window 3x3         Weight values set by user.
        +---------+                 +---------+
        |P1 P2 P3 |                 |M1 M2 M3 |
        |P4 P5 P6 |                 |M4 M5 M6 | 
        |P7 P8 P9 |                 |M7 M8 M9 |
        +---------+                 +---------+
The resulting grey level value R for the smoothed pixel is:

        R = (P1*M1 + P2*M2 + ... +  P9*M9) / (M1 + M2 + ... + M9)
where:

        P1 .. Pn   are grey levels of each pixel in filter window

        M1 .. Mn   are weights (as defined by users) for each pixel
If the sum of filter weights is zero,( M1 + M2 + ... + M9 = 0), then :

        R = (P1*M1 + P2*M2 + ... +  P9*M9)
Example of using filter 3x3 on database image 8x8, using Laplacian mask Q:

                         +---------+                
                         | 0 -1  0 |               
                         |-1  5 -1 |                
                         | 0 -1  0 |               
                         +---------+                

   Image before filtering           Image after filtering

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


About PCI Help Gateway