FGAMMA

Gamma filter


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

Back to top

Description


FGAMMA performs gamma maximum-a-posteriori (MAP) filtering on image data. The gamma MAP filter is primarily used on radar data to remove high-frequency noise (speckle) while preserving high-frequency features (edges).
Back to top

Parameters


fgamma(file, dbic, dboc, flsz, mask, nlook, imagefmt)

Name Type Caption Length Value range
FILE * str Input detected SAR image 1 -    
DBIC * List[int] Input raster channel 1 -    
DBOC * List[int] Output filtered image 1 -    
FLSZ List[int] Filter size 0 - 2 Default: 7,7
MASK List[int] Area mask 0 - 4  
NLOOK List[float] Number of looks 0 - 1 1 - 100
Default: 1
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 horizontal and vertical dimensions of the filter, in pixel units. Acceptable values are positive odd integers. The filter need not be square. Minimum filter sizes are 1x3 or 3x1; the default size is 7x7.

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.

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.

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

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

FGAMMA is used primarily to filter speckled radar data. The filter smoothes the image data, without removing edges or sharp features in the images.

The Gamma MAP filter was first proposed by Kuan. To apply it, the a priori knowledge of the probability density function of the scene is required. Although the scene reflectivity is assumed to be Gaussian distributed, this is not realistic because it implicitly assumes a negative reflectivity. Lopes modified the Kuan Map filter by assuming a gamma distributed scene and setting up two thresholds.

Back to top

Example

Remove the noise from a subarea of the radar image "gatineau.pix" with an NLOOK value of 1. Filter size is 7x7.

from pci.fgamma import fgamma

file	=	'gatineau.pix'
dbic	=	[1]
dboc	=	[1]	# filtered results (overwrite DBIC)
flsz	=	[7,7]	# filter size
mask	=	[1024,1024,2048,2048]	# area to filter
nlook	=	[1.0]	# number of looks
imagefmt	=	'AMP'	# amplitude image format

fgamma( file, dbic, dboc, flsz, mask, nlook, imagefmt )
Back to top

Algorithm

The Gamma Map filter was first proposed by Kuan. To apply it, the a priori knowledge of the probability density function of the scene is required. Although the scene reflectivity was assumed to be Gaussian distributed, this is not quite realistic because it implicitly assumes a negative reflectivity. Lopes modified the Kuan Map filter by assuming a gamma-distributed scene and setting up two thresholds.

FGAMMA performs spatial filtering on each individual pixel in an image using the gray-level values in a window surrounding each pixel. The dimensions of the filter must be odd, and can be from 3x3 to 11x11 pixels. All pixels are filtered. To filter pixels located near edges of the image, edge pixels are replicated to provide sufficient data.

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

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

R = I                    for Ci less than or equal to Cu
R = (B*I + SQRT(D))/(2*ALFA)  for Cu < Ci < Cmax
R = CP                   for Ci greater than or equal to Cmax
where:

For amplitude images, each gray-level will be squared and the square root will be applied to the final result.

FGAMMA also uses a method described in "Adaptive Speckle Filters and Scene Heterogeneity" (see References).

This method removes isolated pixels (pixels of very high or very low value) in homogeneous areas. 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

References

A. Lopes, E. Nezry, R. Touzi, and H. Laur, "Structure detection and statistical adaptive speckle filtering in SAR images", International Journal of Remote Sensing, Vol. 14, No. 9, pp. 1735-1758, 1993.

A. Lopes, R. Touzi, and E. Nezry, "Adaptive Speckle Filters and Scene Heterogeneity", IEEE Transactions on Geoscience and Remote Sensing, Vol 28, No. 6, November 1990.

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

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