FLE

Lee adaptive filter


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

Back to top

Description


FLE applies a Lee adaptive filter on image data. The Lee filter is primarily used on SAR data to remove high-frequency noise (speckle) while preserving high-frequency features (edges).
Back to top

Parameters


fle (file, dbic, dboc, flsz, noise, noisevar, nlook, addmean, mulmean, thrvar, mask, imagefmt)

Name Type Caption Length Value range
FILE * str Input detected SAR image 1 -    
DBIC * List[int] Input raster channel 1 - 1  
DBOC * List[int] Output filtered image 1 - 1  
FLSZ List[int] Filter size (pixels) 0 - 1 3 | 5 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 29 | 31 | 33
Default: 7
NOISE * str Type of noise 4 - 4 ADDI | MULT | BOTH
NOISEVAR List[float] Noise variance 0 - 1  
NLOOK List[float] Number of looks 0 - 1 1 - 100
Default: 1
ADDMEAN List[float] Additive noise mean 0 - 1 Default: 0
MULMEAN List[float] Multiplicative noise mean 0 - 1 Default: 1.0
THRVAR List[float] Variance threshold 0 - 1 Default: 0.0
MASK List[int] Area mask 0 - 4  
IMAGEFMT str Image units 0 - 9 Amplitude | Power
Default: Amplitude

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the file that contains the image data to be filtered and to receive the output.

DBIC

Specifies the channel in the input detected SAR image to be processed.

DBOC

Specifies the output channel to receive the filtered results. This channel must already exist within the input file (FILE). If this parameter specifies the same channel as the one defined as the input (DBIC), DBOC overwrites the input channel.

FLSZ

Optionally specifies the filter size of the square window, in pixel units. The value must be an odd integer between 3 and 33. The default size is 7 by 7 pixels. Only one value should be specified.

NOISE

Specifies the type of the noise in the input image channel.

Values include:
Note: For most radar data, the noise is usually multiplicative.

NOISEVAR

Optionally specifies the noise variance in the input image channel.

To measure this value, select a flat area of the image and run HIS to calculate the standard deviation of the area. NOISEVAR is equal to the square of the standard deviation of the flat area. For multiplicative noise, if a flat area on the image is unknown, use the NLOOK parameter to estimate the noise variance (see the NLOOK parameter for more information). If both NOISEVAR and NLOOK are unspecified, NOISEVAR defaults to zero.

NLOOK

Optionally specifies the effective number of looks of the SAR image. This is used to derive noise variance. Over homogeneous areas, the effective number of looks can be computed as the mean value squared divided by the variance (for amplitude data) or the mean divided by the standard deviation (for power data). By adjusting this parameter value, you can control the amount of smoothing applied to the image.

Acceptable values are 1 to 100. The default value of 1 is appropriate for single-look data and specifies maximum smoothing correction to the image.

NLOOK calculates the multiplicative noise variance of the image if the NOISEVAR is not specified. If this parameter is specified and NOISEVAR is not, NOISEVAR will be equal to 1/NLOOK with noise mean equal to 1. If NOISEVAR is specified, this parameter is ignored.

ADDMEAN

Optionally specifies the additive noise mean for the image channel. Defaults to 0, specifying uniformly distributed noise.

Note: If the value of NOISE is specified as 'MULT', this parameter is ignored.

MULMEAN

Optionally specifies the multiplicative noise mean for the image channel. Defaults to 1, specifying uniformly distributed noise.

Note: If the value of NOISE is specified as 'ADDI', this parameter is ignored.

THRVAR

Optionally specifies the filter window variance threshold for the image channel. If this parameter is unspecified, the variance threshold is ignored.

This parameter detects edges and activates the Improved Lee Filter. THRVAR should only be specified for a 7x7 or a 9x9 filter window.

MASK

Optionally specifies the window or bitmap that defines the area to be processed within the input raster. If this parameter is not specified, the entire channel is processed.

A window mask is specified as follows:

            MASK=Xoffset, Yoffset, Xsize, Ysize 
          

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

For a bitmap mask, you can specify the bitmap segment number from the input file (FILE) that you want to use. All the pixels within the specified segment, having a pixel value of 1, define the area to be processed.

Only the area under the mask is written to the output.

IMAGEFMT

Optionally specifies the image format of the SAR image, which defines how the correction factor should be computed. By default, the image is assumed to be in amplitude units.

Image units can be "Amplitude" (or equivalently "AMP") or "Power" (or equivalently "POW").

Back to top

Details

FLE applies Lee filtering on image data. The Lee filter smoothes out noise while retaining edges and sharp features in the image.

There are three options for removing noise from the image, specified by the NOISE parameter values:
Note: For most radar data, the noise is multiplicative.

The mean value of the additive noise (ADDMEAN) is usually 0. The mean value of multiplicative noise (MULMEAN) is usually 1.0.

To calculate noise variance, use a bitmap or window mask on a flat area of the image, such as a sea or plain, and run HIS. NOISEVAR is the square of the standard deviation of the flat area.

For multiplicative noise, if a flat area from the image is unknown, the user can calculate the noise variance by specifying the number of looks (NLOOK) of the image. NOISEVAR is equal to 1/NLOOK.

If the Threshold Variance (THRVAR) is specified, a filter window with a variance higher than the threshold value is processed with the Improved Lee Filter, which takes into account the orientation of the edge. If THRVAR is not specified, NOISEVAR must be specified. THRVAR can be used only on filter windows 7x7 or 9x9 in size.

FLE performs spatial filtering on each individual pixel in an image using the gray-level values in a square window surrounding each pixel. The dimensions of the filter must be odd values and must be at least 3x3. Different filter sizes will greatly affect the quality of processed images. If the filter is too small, the noise filtering algorithm is not effective. If the filter is too large, subtle details of the image will be lost in the filtering process.

All pixels are filtered. To filter pixels located near the edges of the image, edge-pixel values are replicated to provide sufficient data.

Back to top

Example

Remove the multiplicative noise from a subarea of the radar image 'gatineau.pix'. In order to find noise variance, the HIS function is run on a window of a flat area. The square of the statistical standard deviation of the gray levels in this area is the variance noise (NOISEVAR=388). The user can also determine the noise variance for multiplicative noise image if the number of looks of the image is known. Filter size is 7x7 and multiplicative noise mean is 1. The output channel has already been created.

from pci.fle import fle

file	=	'gatineau.pix'
dbic	=	[1]	# channel to be filtered
dboc	=	[5]	# filtered results
flsz	=	[7]	# specifies a 7x7 filter
noise	=	'MULT'	# multiplicative noise
noisevar	=	[388]	# noise variance
nlook	=	[]	# number of looks; defaults to 1.0
addmean	=	[]	# ignore additive mean
mulmean	=	[]	# defaulted to 1.0.
thrvar	=	[]	# ignore variance threshold
mask	=	[1024,1024,2048,2048]	# process only this subset
imagefmt	=	'AMP'	# amplitude image format

fle( file, dbic, dboc, flsz, noise,noisevar, 
     nlook,addmean,mulmean,thrvar,mask, imagefmt )
      
Back to top

Algorithm

FLE performs spatial filtering on each individual pixel in an image using the gray-level values in a square window surrounding each pixel. The dimensions of the filter must be odd, and must be at least 3x3, with a maximum size of 11x11. The default filter size is 7x7.

All pixels are filtered. To filter pixels located near the edges of the image, edge-pixel values are replicated to provide sufficient data.

        +----------+
        | a1 a2 a3 |
        | a4 a5 a6 |     <---  Filter window 3 X 3
        | a7 a8 a9 |
        +----------+
      

The Lee Filter function FLE is implemented as follows, for different types of noise.

Algorithm for additive noise

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

        R = I + K * (CP - I)
      

where:

        K = QVAR  / (QVAR + AVAR)
      

Algorithm for multiplicative noise

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

        R = I + K * (CP - U*I)
      

where:

        (MVAR/U**2)
        K = 1 - -----------
        (QVAR/I**2)
      

Algorithm for combined additive and multiplicative noise

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

        R = I + K * (CP - U*I - W)
      

where:

        K = (U*QVAR)  / (QVAR*U**2 + I**2*MVAR+AVAR)
      

The multiplicative noise variance is calculated from local statistics in the filter window:

        MVAR = (SD / I)**2
      

The mean value of additive noise is usually 0. The mean value of multiplicative noise is usually 1.

The THRVAR parameter (only for 7x7 and 9x9 windows) reduces noise in the edge areas, using the Improved Lee Filter. The filter redefines the specified filter window near the high-contrast regions, taking into account the orientation of edges. For each high local variance (high-contrast point) over the threshold (THRVAR), a gradient is computed to obtain the orientation of the edge. The subset of pixels in the local area on either side of the edge is then defined; the local variance is reduced and the noise along the edge is removed.

For further information on the Improved Lee Filter, refer to the following paper:

J.S.Lee, "Refined Filtering of Image Noise Using Local Statistics", Computer Graphic and Image Processing 15, 380-389 (1981).

Back to top

References

Zhenghao Shi and Ko B. Fung, 1994, "A Comparison of Digital Speckle Filters", Proceedings of IGRASS 94, August 8-12, 1994.

Jong-Sen Lee, "Digital Image Enhancement and Noise Filtering by Use of Local Statistics", IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. PAM1-2, No. 2, March, 1980.

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