FPR

Programmable filter


EnvironmentsPYTHON :: EASI :: MODELER
Batch ModeYes
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Related

Back to top

Description


FPR performs programmable filtering on image data, averaging the data according to weights you specify.
Back to top

Parameters


Name Type Length Value range
Input: Unfiltered layer: Input raster channel or layer * Raster port 1 - 1  
Output: Filtered layer: Output channel or layer * Raster port 1 - 1  
Port Settings: Resample mode Raster port 1 - 1024 Nearest | Bilinear | Cubic
Default: Nearest
Filter X Size Integer 0 - 1 1 | 3 | 5 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 29 | 31 | 33
Default: 3
Filter Y Size Integer 0 - 1 1 | 3 | 5 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 29 | 31 | 33
Default: 3
Mask: Area mask layer or channel Bitmap port 0 - 4  
Text File for Filter Weights String 0 - 1  
Background set to zero String 0 - 1 Yes, No
Default: Yes
Matrix: Row 01 Float 0 - 11  
Matrix: Row 02 Float 0 - 11  
Matrix: Row 03 Float 0 - 11  
Matrix: Row 04 Float 0 - 11  
Matrix: Row 05 Float 0 - 11  
Matrix: Row 06 Float 0 - 11  
Matrix: Row 07 Float 0 - 11  
Matrix: Row 08 Float 0 - 11  
Matrix: Row 09 Float 0 - 11  
Matrix: Row 10 Float 0 - 11  
Matrix: Row 11 Float 0 - 11  
Report String 0 - 192 See parameter description

* Required parameter
Back to top

Parameter descriptions

Input: Unfiltered layer: Input raster channel or layer

The input channel or layer to filter.

Output: Filtered layer: Output channel or layer

The output channel or layer to receive the output results.

The output channel or layer can be the same as the input channel or layer, and you can also specify more than one of either, if necessary.

Only the area under the mask is processed. If no mask is specified, FPR filters the entire channel.

Port Settings: Resample mode

The type of image resampling to apply.

You can choose from the following methods:

Filter X Size

The horizontal size of the filter, in pixels. The value you specify must be an odd integer ranging from 1 through 33. The default value is 3.

This parameter is optional.

Filter Y Size

The vertical size of the filter, in pixels. The value you specify must be an odd integer ranging from 1 through 33. The default value is 3.

Mask: Area mask layer or channel

The area in the input image to filter.

If no bitmap is specified, the entire layer is processed.

This parameter is optional.

Text File for Filter Weights

The name of the text file that contains the filter weights that are used for a filter you have defined. The text file is a space-delimited matrix of weight values that correspond to the window size of the filter.

Each line of the text file must contain the coefficients of the corresponding row of the filter. Field i of line j of the text file must contain the coefficient of row j, column i of the filter. The fields must be whitespace-delimited.

Note: If the filter matrix-row parameters 01 through 11 are specified, this parameter is ignored.

Background set to zero

Whether to set the background to zero or to keep the value outside the specified mask area.

If you do not select one or more files for the MASK: Area mask parameter, this parameter is ignored.

Matrix: Row 01

The row elements of the filter matrix.

For more information, see Details.

Matrix: Row 02

The row elements of the filter matrix.

For more information, see Details.

Matrix: Row 03

The row elements of the filter matrix.

For more information, see Details.

Matrix: Row 04

The row elements of the filter matrix.

For more information, see Details.

Matrix: Row 05

The row elements of the filter matrix.

For more information, see Details.

Matrix: Row 06

The row elements of the filter matrix.

For more information, see Details.

Matrix: Row 07

The row elements of the filter matrix.

For more information, see Details.

Matrix: Row 08

The row elements of the filter matrix.

For more information, see Details.

Matrix: Row 09

The row elements of the filter matrix.

For more information, see Details.

Matrix: Row 10

The row elements of the filter matrix.

For more information, see Details.

Matrix: Row 11

The row elements of the filter matrix.

For more information, see Details.

Report

Specifies where to direct the generated report.

Available options are:

Back to top

Details

FPR performs programmable filtering on image data. The programmable filter averages image data according to weights you have specified. By using FPR, you can design filters for specific requirements, such as directional filters or Laplacian filters. The filter dimensions must be odd, with acceptable values ranging from 1 x 1 through 33 x 33. You must specify a matrix of real weights to apply to each pixel within the filter area. FPR does not normalize the filter weights.

Each row of the filter matrix is stored in a separate parameter (Matrix: Row 01, Matrix: Row 02, Matrix: Row 03...Matrix: Row 11).

The output channel or layer can be the same as the input channel or layer.

The MASK parameter specifies the area within the input channel to process. Only the area under the mask is filtered. The rest of the image is unchanged.

Filter-matrix parameters

The filter-matrix parameters 01 through 11 define the matrix-row elements.

The implementation of a programmable filter consists of applying a set of weighting values (M) for each pixel (P) that you define. All pixels are filtered. To filter pixels located near the edges of the image, FPR replicates edge-pixel values to provide sufficient data.

Filtered window 3 x 3Weight values set by you
           	    +---------+             +---------+
           	    |P1 P2 P3 |		    |M1 M2 M3 |
       	            |P4 P5 P6 |             |M4 M5 M6 | 
       	            |P7 P8 P9 |		    |M7 M8 M9 |
	            +---------+		    +---------+  
    

The resulting gray-level value R for the smoothed pixel is:

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

If the sum of filter weights is zero ( M1 + M2 + ... + M9 = 0):

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

The following example applies a Laplacian mask Q on a 3 x 3 filter area of an 8 x 8 image:

                                    +---------+                
                                    | 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 leftmost example, Image before filtering, columns and scan lines outside the box represent the last image column or scan line being reused, in cases where the filter does not have a full window.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.