FFREQ

Frequency domain image filter


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

Back to top

Description


Applies a user-designed filter (specified in graphics planes) and/or a built-in radial filter to channels of a frequency domain image.
Back to top

Parameters


Name Type Caption Length Value range
FILI* String Input file name 1 - 192  
FILO* String Output file name 1 - 192  
DBIC* Integer Input frequency domain channel(s) 1 - 16  
DBOC* Integer Output filtered frequency domain channel(s) 1 - 16  
DBIW Integer Raster input window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
DBOW Integer Raster output window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
BNGF Integer Bitmaps of Graphical Filters 0 - 16  
BDWD Integer Border width of graphical filter 0 - 1 0 - 100
Default: 0
FRAD String Radial filter type 0 - 2 BH | BL | GH | GL
Default: BH
FC Float Cutoff frequency for radial filter 0 - 1 0.0 - 1.0
Default: 0.5
TFORM String Transformation type 0 - 3 FIR | FMP | WAL | HAD | COS
Default: FIR
REPORT String Report mode 0 - 192 Quick links
MONITOR String Monitor mode 0 - 3 ON, OFF
Default: ON

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the PCIDSK file from which frequency data is read.

FILO

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

FILO can be the same as FILI. The specified output file must exist before running this function.

DBIC

Specifies the input channel(s) containing frequency data.

The channels must contain 32-bit floating point values, and can be either real or complex. The input channels must be of the same data type, either all real-valued, or all complex-valued.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

DBOC

Specifies the output channel to receive the filtered image.

There must be as many output channels specified as there are input channels. All output channels must be of the same data type as input channels.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

DBIW

Specifies the raster window (Xoffset, Yoffset, Xsize, Ysize) read from the input image. If this parameter is not specified, the entire image is processed by default.

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.

DBOW

Specifies the raster window (Xoffset, Yoffset, Xsize, Ysize) to be output. If this parameter is not specified, the entire layer is output by default.

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.

Note: This window must be exactly the same size as the input window.

BNGF

Specifies the bitmap segments containing user-defined graphical filters. If more than one bitmap plane is specified, they are assembled together to form the area affected by the filter. If this parameter is not specified, no graphical filter is applied.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

BDWD

Specifies the border width, in pixels, of the graphical filter.

A gradually decreasing border is generated at the boundary of the filter regions so that the filter gain smoothly decreases from 1 to 0. The width is provided in pixels (wave numbers). Half of the border width is inside the region and the other half is outside the region.

FRAD

Specifies the type of filter applied on top of the filter specified by the graphics planes.

Supported options are:

If this parameter is not specified, no filter is applied.

FC

Specifies the cutoff frequency for the radial filter, in fraction of highest image frequency (0 < fc < 1).

For Butterworth filters, this parameter specifies the point at which the filter gain is 0.707. For Gaussian filters, it specifies the standard deviation.

TFORM

Specifies the type of transformation in the input frequency channels. All input channels are assumed to be created with the same transformation type, and it is preserved in the output channels.

Supported transformation are:

The type of transformation defines the position of the lowest frequency: at image center for the two Fourier transformations, and at image upper left corner for the COS, HAD and WAL transforms. It also controls the handling of mask values, as described in the Details section below.

REPORT

Specifies where to direct the generated report.

Available options are:

MONITOR

The program progress can be monitored by printing the percentage of processing completed. A system parameter, MONITOR, controls this activity.

Available options are:

Back to top

Details

FFREQ applies a user-designed filter (specified in graphics planes) and/or a built-in radial filter to channels of a frequency domain image.

Once an image is transformed into a frequency domain using FTF, certain noisy patterns in the original image now appear as strong energy concentrations in the frequency image. Masking out these frequency components achieves the effect of filtering out the noisy patterns when the frequency image is transformed back to the spatial domain using FTI.

The filtering-out (attenuation or removal) of some frequencies reduces the overall energy in the transform, and lowers the mean value of the back-transformed image. For low-pass filters the effect is minor. However, if the zero frequency (DC component of the spectrum) is removed, the mean of the back-transformed image will drop to a value close or equal to zero. This is an expected effect of the high-pass filtering of the image.

FFREQ allows two types of filters to be applied to a frequency domain image. First, you may specify the frequency components to remove by masking the corresponding regions on a graphics plane. FFREQ turns this bitmap into a filter and zeroes-out the underlying pixels in the frequency image. To reduce artifacts in the filtered image caused by sharp cutoffs in the frequency image, FFREQ automatically generates a smooth border at the boundaries of the mask regions, so that the filter gain gradually decreases from 1 to 0 within the border. The width of the border can be specified using the Border Width (BDWD) parameter.

For a real-valued image (such as an image from an optical sensor, or a detected radar image), its Fourier transform exhibits a property of conjugate symmetry about the center of the image: at a pair of corresponding points, the real parts of the Fourier transformation are equal and the imaginary parts have the same magnitude but opposite signs. For complex-valued images (such as single-look complex radar images) there is no such symmetry. FFREQ assumes that transforms stored in real-valued channels (DBIC) are produced from real-valued images, while transforms stored in complex-valued channels are created from complex images.

To maintain a real image after applying the filter, FFREQ ensures that for the Fourier transforms stored in real-valued channels the graphical filter is symmetrical at the center of the image. Particularly, if any pixel is set by the user, both this point and its symmetrical point are considered to be set. Thus, you need only define the filter on any half of the image. For other transform types (COS, HAD, WAL, and Fourier transforms stored in complex channels), symmetry is not enforced and the entire bitmap is used as specified.

FFREQ can also apply pre-defined radial filters to an image. The supported filter types are Gaussian and Butterworth. The Gaussian filter is smooth while the Butterworth filter has a much sharper cutoff edge. The Butterworth filter is a good choice when signal and noise are clearly separable. Otherwise, the Gaussian filter is preferred, as it minimizes artifacts. The polynomial order of the Butterworth filter is fixed at 8, which is appropriate for most common uses.

The Transformation Type (TFORM) parameter indicates the location of the zero-frequency component of the frequency image. If this parameter is set to FIR or FMP, zero-frequency is assumed to be at the image center. For all other values (COS, WAL, HAD), zero-frequency is assumed to be at the top-left corner of image.

For Fourier-transformed images, if the images are stored as Real and Imaginary parts, both parts should be filtered at the same time. If the images are stored as Magnitude and Phase, only the Magnitude part should be filtered; the Phase part should not be passed in as an input channel. The unchanged phase image is necessary for restoring the filtered image to the spatial domain.

Back to top

Example

The following example assumes that the user has defined a mask filter in the graphics plane in segment 2. The graphical mask contains regions superimposed on the frequency image. Each pixel in the masked region corresponds to a frequency component to be eliminated. In the boundary of a mask region, a gradually decreasing border of 10 pixels wide is to be generated. In addition, a low-pass Gaussian filter with the cutoff frequency at 0.5 is to be applied to the image. Both filters are applied to transform image channels 1 and 2 (which are the result of a Fourier transformation of a real-valued detected radar image) and the output images are saved in channels 3 and 4.

EASI>fili	=	'jers1.pix'
EASI>filo	=	'jers1.pix'
EASI>dbic	=	1,2
EASI>dboc	=	3,4
EASI>dbiw	=		! default, entire image
EASI>dbow	=		! default, entire image
EASI>bgnf	=	2	! bitmap segment containing graphical filters
EASI>bdwd	=	10	! border width of graphical filter
EASI>frad	=	'GL'	! low-pass Gaussian filter
EASI>fc	=	0.5	! cutoff frequency for radial filter
EASI>tform	=	"FIR"	! Fourier with real, imaginary transformation

EASI>run FFREQ

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