FTI

Frequency inverse transformation


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

Back to top

Description


Converts two-dimensional frequency domain data to spatial imagery data using one of the following inverse transformations: Fourier, Hadamard, Walsh, or Cosine.
Back to top

Parameters


fti(fili, filo, dbic, dboc, dbiw, dbow, tform, filb)

Name Type Caption Length Value range
FILI* str Input file name 1 -    
FILO* str Output file name 1 -    
DBIC* List[int] Input frequency domain channel(s) 1 - 2  
DBOC* List[int] Output spatial domain channel 1 - 1  
DBIW List[int] Raster input window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
DBOW List[int] Raster output window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
TFORM* str Transformation type 3 - 3 FIR | FMP | WAL | HAD | COS
Default: FIR
FILB str Buffer file name 0 -    

* 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.

The processing is performed in the pixel domain, and the input and output images are assumed to have the same dimensions, projection, and pixel size.

DBIC

Specifies the input frequency domain channel(s) to be transformed to the spatial domain.

The number and type of input channels depend on the transformation being performed (as specified by the parameter TFORM below):

DBOC

Specifies the output channel to receive the spatial domain data; that is, the result of the transformed image data. Complex-valued output channels are supported.

DBIW

Defines the area of the frequency image that will be transformed to spatial data. If this parameter is not specified, the transformation is applied to the full extents of the frequency image by default. The frequencies outside the specified area will be filtered out, and not used to derive the transformed spatial image.

This parameter is defined differently depending on the specified transformation type (TFORM). The various transformation types have the zero-frequency (DC) component at different locations in the frequency image:

The input window must then be carefully specified to obtain the desired filtering result.

The input window is specified as follows:
Xoffset, Yoffset, Xsize, Ysize
where:

The window size (Xsize, Ysize) must be a power of 2, and must be at least 4 in size.

Note: If this parameter is not specified, the output window parameter (DBOW) must also be unspecified.

DBOW

Defines the area of the output spatial image to receive the transformed data.

If the input window is not defined, this parameter must also be unspecified.

The output window is specified as follows:
Xoffset, Yoffset, Xsize, Ysize
where:

The window size (Xsize, Ysize) must be a power of 2 and define an area at most as large as the input window size (DBIW).

The inverse transformation recreates the full spatial extent of the image used to derive the input frequency image, but with some of the frequencies removed (filtered out). If the output window is defined, the full recreated image is downsampled to fit into the specified window.

TFORM

Specifies the type of transformation to perform.

Available transformations are:

FILB

Optionally specifies the name of the temporary buffer file.

Because this function uses large amounts of RAM, a temporary buffer file is automatically created for large images. This parameter records the name of the buffer file created by FTI. Typically, no user interaction is required for this parameter.

Back to top

Details

FTI converts two-dimensional frequency domain data, usually created by FTF, to spatial domain imagery data using one of the following transformations: inverse Fourier with real and imaginary input (FIR); inverse Fourier with magnitude, phase input (FMP); inverse Walsh (WAL); inverse Hadamard (HAD); or inverse Cosine (COS).

For Fourier transformations (FIR or FMP), 32-bit floating point values must be provided on input, either in a single complex channel, or in two real-valued channels. If a complex channel is used for input, the format is reset to FIR (real and imaginary values). The zero frequency (DC component) must be in the center of the input image. For the COS, HAD and WAL inverse transformations, a single 32-bit real input channel is required and the zero frequency should be at the upper-left corner of the image. In all cases, the result is a single output channel. For the FIR and FMP transformations the output channel may be complex.

Before running FTI, ensure that the output file (FILO) exists; if it does not, create it by executing CIM.

The input window size (Xsize, Ysize) must be a power of 2 (for example: 64,128, 256, 512, ...). The output window size must not exceed the input window size.

If an input window is specified, the function removes all frequencies outside the defined window from the inverse transformation, effectively performing a frequency filtering operation. The input window must be carefully positioned to achieve the desired effect. In the most common applications, the high frequencies are eliminated; in these cases, the window should be centered within the image for the two Fourier transforms (FMP and FIR), and positioned in the upper-left corner of the image for the remaining transformations (WAL, HAD and COS).

The inverse transformation recreates the full extent of the original spatial image used to create the transformed image. The recreated spatial image is then placed in the area specified by the output window. If the window is defaulted to the full image area, the spatial extent and resolution of the recreated image are the same as that of the original spatial image. If a smaller output window is specified, the full extent of the recreated image is downsampled to fit the specified area. In this case, the function performs two functions: the frequency filtering and spatial downsampling.

Because FTI does not require the entire image to be loaded into memory, there is no limit on the size of input image. If necessary, the function automatically creates a buffer file, if FILB is not specified. The buffer file name is recorded in FILB for efficiently reusing the buffer in another run.

Back to top

Example

Compute an inverse Walsh transformation of size 256 x 256 in channel 1 of the file 'geomess.pix'. Write the result to the file 'inverse.pix'.

from pci.fti import *

fili	=	'geomess.pix'	# input file
filo	=	'inverse.pix'	# output file
dbic	=	[1]	# input channel
dboc	=	[2]	# output channel
dbiw	=	[0,0,256,256]	# raster input window
dbow	=	[128,128,256,256]	# raster output window
tform	=	'WAL'	# Walsh inverse transformation
filb	=	''	# default, no buffer file

fti (fili, filo, dbic, dboc, dbiw, dbow, tform, filb)
Back to top

Algorithm

Refer to the Algorithm section of the FTF help for algorithm descriptions.

Back to top

References

Gonzalez, R.C. and Wintz, P. [1987]. Digital Image Processing. 2nd Edition, Addison-Wesley, Massachusetts.

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