FLTRNOI

Filter Noisy Images


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example :: Related

Back to top

Description


FLTRNOIS filters noise in an image channel or layer, using a registered noise-free reference image that is sampled at the same pixel size as the noisy image. The reference image can be from a different date, frequency band, and sensor.
Back to top

Parameters


fltrnoi(fili_ns, fili_ref, filo, dbic_ref, dbic_ns, dboc, maxgain, ksize, enh)

Name Type Caption Length Value range
FILI_NS * str Input noisy file name 1 -    
FILI_REF * str Input reference file name 1 -    
FILO * str Output file name 1 -    
DBIC_REF * List[int] Input reference channel(s) or layer(s) 1 - 1  
DBIC_NS * List[int] Input noisy channel(s) or layer(s) 1 - 1  
DBOC * List[int] Output raster channel(s) or layer(s) 1 - 1  
MAXGAIN List[float] Maximum model gain 0 - 1 0.0 - 256.0
Default: 3.0
KSIZE List[int] Kernel size (pixels) 0 - 1 1 - 100
Default: 7
ENH List[float] Enhancement factor 0 - 1 0 - 10.0
Default: 1.0

* Required parameter
Back to top

Parameter descriptions

FILI_NS

Specifies a PCIDSK file that contains the noisy image data to filter.

Note: The dimensions of FILI_NS and FILI_REF must be identical.

FILI_REF

Specifies a PCIDSK file that contains the reference image data.

The reference image must have the same dimensions as the input noisy image (FILI_NS).

FILO

Specifies the name of the file to receive the output filtered image data.

The filtered image data will be placed in the channel specified in DBOC. The dimensions and type (8-bit unsigned) of the output file must be identical to those of the input noisy file (FILI_NS) and the input reference (FILI_REF).

DBIC_REF

Specifies the image channel to be used as the noise-free reference. This must be an 8-bit unsigned image channel.

DBIC_NS

Specifies the noisy image channel or layer to filter. This must be an 8-bit unsigned image channel.

DBOC

Specifies the output channel(s) or layer(s) to receive the noise-filtered results.

This must be an 8-bit unsigned image channel.

MAXGAIN

Specifies the maximum model gain (MAXGAIN) to be used during enhancement. Lower values reduce the tendency of the algorithm to introduce noise into water regions. A typical starting value is 3 (default value). If noise results in water regions, reduce the maximum gain value.

Note: A maximum gain value of less than one will result in blurred edges.

KSIZE

Specifies the size of the linear kernels on which the cross-correlation modelling is performed. Correlation is done on a window size of ( 2 * KSIZE + 1 ) pixels.

A kernel size of less than 3 will produce noisier images. Kernel sizes greater than 7 will blur edges.

ENH

Specifies the degree of enhancement. This parameter provides as output a linear combination of the noisy input and the filtered version. Values lower than 1 will be noisier.

Back to top

Details

FLTRNOI performs a cross-correlation between the input reference image (FILI_REF) and the input noisy image (FILI_NS), and creates a horizontal and vertical kernel defined by the Kernel Size (KSIZE) parameter. As this kernel scans across the window, the merit of both the horizontal and vertical kernels are evaluated, and the correlation coefficients (b0 and b1) of the kernel with the best merit are used. When the b0 and b1 matrices are obtained, the output image is reconstructed using the reference image b0 and b1 matrices in the following manner:

ORIGINAL_OUTPUT = B0 + B1 * FILI_REF

The amount of smoothing while preserving edge detail in the output image can be controlled with the maxium model gain parameter (MAXGAIN), which sets the upper limit of the B1 coefficient of the kernel with the best merit. For example, setting MAXGAIN = 0 results in FILI_NS as output, with no enhancement applied.

The ENH (degree of enhancement) parameter controls the enhancement factor for the noise reduction filter:

OUTPUT = ENH * ORIGINAL_OUTPUT + (1 - ENH) * FILI_NS

An enhancement factor of 1 produces only the enhanced image. An enhancement factor is 0 produces only the noisy image. As the enhancement factor is adjusted from 0 -> 1, the amount of enhancement increases as the percentage of information from the noisy image decreases.

Back to top

Example

In the image database l7_ms.pix, cross model channel 1 (the noisy image) with channel 1 of fl_reference.pix (the reference image), and place the output image into channel 6 of l7_ms.pix.

Use a MAXGAIN of 3, a kernel size of 7, and set the ENH to 1 (100% enhancement).

from pci.fltrnoi import fltrnoi

fili_ns  =  "l7_ms.pix"	# input file with noise channel
fili_ref  =  "fl_reference.pix"	# input file with reference channel
filo  =  "l7_ms.pix"	# output file
dbic_ns  =  [1]	# noise channel
dbic_ref  =  [1]	# reference channel
dboc  =  [6]	# output channel
maxgain  =  [3]	# maximum model gain
ksize  =  [7]	# kernel size
enh  =  [1]	# enhancement factor

fltrnoi( fili_ns, fili_ref, filo, dbic_ref, dbic_ns, dboc, maxgain,
ksize, enh )

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