PSPOLFIL

POLSAR Lee adaptive filter


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

Back to top

Description


PSPOLFIL applies a Lee adaptive-speckle filter to an input SAR data set. It reduces speckle in the image, while preserving the polarimetric and spatial information of the image. Spatial information is preserved by using an edge detector to identify a homogeneous local neighborhood over which to estimate the filter parameters.
Back to top

Parameters


pspolfil (fili, filo, flsz, nlook)

Name Type Caption Length Value range
FILI * str Input polarimetric SAR image 1 -    
FILO * str Output filtered image 1 -    
FLSZ List[int] Filter size (pixels) 0 - 1 5 | 7 | 9 | 11 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 29 | 31 | 33
Default: 5
NLOOK List[float] Equivalent number of looks 0 - 1 1 -

* Required parameter
Back to top

Parameter descriptions

FILI

The name of the input polarimetric SAR data set that contains the input data to filter. The input data set must contain either non-symmetrized or symmetrized fully polarimetric (quad-polarization) data in scattering, covariance, coherence, or Kennaugh matrix format.

The input data set must be a data set that has already been imported into the PCIDSK (.pix) format by SARINGEST, or it may be the key file name of any GDB-supported POLSAR data set in its distribution format. For more information, including a complete list of supported SAR sensors and data products, follow the link to SARINGEST under Related functions at the end of this topic.

FILO

The name of the output filtered polarimetric SAR image. The output data set has the same dimensions as the input. The number of output channels is the same as in the input image for data in the covariance, coherency, and Kennaugh matrix formats. Input data sets in the scattering matrix format are converted to the covariance matrix format automatically. For such data, the number of output channels depends on the symmetry of the input matrix.

The specified file must not already exist.

The output image represents the same physical quantity as the input data set (beta0, sigma0, or gamma0).

FLSZ

The size of the square filter window that is moved across the input image to determine the output pixel value. An odd integer between 5 and 33 must be specified; the default value is 5. Increasing the value of this parameter increases the processing time at approximately a quadratic rate."

NLOOK

The equivalent number of looks (ENL) in the input data set. The minimum valid value is 1. A float greater than or equal to 1 should only be specified if the data has already been speckle-filtered. The maximum value depends on the type of product being used. If this parameter is not specified, PSPOLFIL will try to find the number of looks in the metadata. If the number of looks is not found in the metadata, a default value of 1, which corresponds to single-look images, is applied.

Instead of 1, the default value of this parameter will be the file level metadata value for 'NumLooks' if this metadata exists.

Note: You can estimate the ENL by calculating the ratio of the mean to standard deviation (intensity data) or mean-squared-to-variance ratio (of the amplitude intensity data) in a homogenous area.
Back to top

Details

PSPOLFIL applies a Lee adaptive-speckle filter to an input SAR data set. As opposed to the boxcar filter, this filter preserves the edges. Edge detection and homogeneity parameters are estimated from the local power image.

The input file must represent a SAR data set in one of the following matrix formats:
Input data sets in the scattering matrix format are converted to the covariance matrix format before filtering. For such data, the output matrix type and the number of channels in the output file depend on the input matrix type, as follows:

For input data in all other matrix formats, the output matrix type and the number of channels in the output file are the same as in the input file.

Back to top

Example

Apply a speckle filter to a SIR_C data set. The input SIR-C MLC-Q data set is already imported into the PCIDSK format. Use the default 5 filtering window.

from pci.pspolfil import pspolfil

fili	="sir_c.pix"
filo	="sc_sp5x5.pix"
flsz	=[]
nlook	=[5.6529984]

pspolfil( fili, filo, flsz, nlook )
      
Back to top

Algorithm

The algorithm in PSPOLFIL is based on the article in the reference section. If the input data set is in the scattering matrix format, it is converted to the covariance matrix format. The total power image is then created as in the PSTOTPOW program. Every pixel P(i,j) of the total power image represents the sum of intensities of all polarizations in the input data set.

The total power image is then averaged with a 3x3 window as follows:

        1    1     1
        Pav(i,j) = - * Sum ( Sum ( P(i'+i,j'+j) ) )
        9  i'=-1 j'=-1
      

Several working parameters are derived as follows:

        L = NUMLK
        N = WINSIZE
        m = (N - 3) / 2
        n = (N + 1) / 2
        N2 = (N * (N + 1)) / 2
      

PSPOLFIL then loops over all lines and pixels of the input data set. The processing at every pixel proceeds as follows:

Back to top

Acknowledgements

PCI Geomatics gratefully acknowledges the financial support provided by the Canadian Space Agency through the Earth Observation Application Development Program (EOADP), contract number 9F028-034946.

Back to top

References

Lee J.S., M.R. Grunes, and G. de Grandi. "Polarimetric SAR speckle filtering and its implication for classification", IEEE Trans. Geosci. Remote Sensing, 37, no. 5 (1999): 2363-2373.

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