image1 pointer to xvimage structure of type FLOAT or
COMPLEX.
image2 pointer to xvimage structure of type FLOAT
(optional).
dir integer specifying the direction of the FFT
transform. 0 is forward, 1 is inverse.
OUTPUT
c_flg is an integer requesting that a complex out-
put image be produiced. Non-zero means pro-
duce the image.
o_image1 is a pointer to the image structure pointer
that will receive the complex output image,
if it is desired (see above).
r_flg is an integer requesting that a real output
image be produced. Non-zero means produce
the image.
o_image2 is a pointer to the image structure pointer
that will receive the real output image, if
it is desired (see above).
i_flg is an integer requesting that a imaginary
output image be produced. Non-zero means
produce the image.
o_image3 is a pointer to the image structure pointer
that will receive the imaginary output image,
if it is desired (see above).
Return Value: 1 on success, 0 on failure.
vfft computes the 2 dimensional Fast Fourier Transform of
an image. The input image should be square and the number
of rows (or columns) MUST be a power of two.
This program will compute either a forward or inverse FFT,
depending on the direction requested with the dir argument.
A dir value of 0 will result in a forward FFT, and a dir
value of 1 will result in an inverse FFT.
The arguments to the library routine include:
image1 specifies the xvimage structure to either the com-
plex or real component of the input image.
image2 specifies the optional xvimage structure to the
imaginary component of the input image. Designed
to work in conjunction with the real component of
the input image. If this image is not to be sup-
plied to vfft, then supply the value NULL for
this argument.
c_flg is an integer flag specifying whether a complex
output image is to be produced. If the c_flg is
non-zero, then an image is created which will con-
tain the complex output image.
o_image1 is a pointer to the optional xvimage structure
corresponding to the complex output image. See
c_flg. If this argument is unused, supply the
value NULL.
r_flg is an integer flag specifying whether a real out-
put image is to be produced. If the r_flg is
non-zero, then an image is created which will
contain the real part of the complex result.
o_image2 is a pointer to the optional xvimage structure
corresponding to the real output image. See r_flg.
If this argument is unused, supply the value NULL.
i_flg is an integer flag specifying whether an imaginary
output image is to be produced. If the i_flg is
non-zero, then an image is created which will con-
tain the imaginary part of the complex result.
o_image3 is a pointer to the optional xvimage structure
corresponding to the imaginary output image. See
i_flg. If this argument is unused, supply the
value NULL.
dir is an integer that specifies the FFT direction. A
value of 0 results in a forward FFT, and a value
of 1 results in an inverse FFT.
If an input image is of data type COMPLEX, then both the
real and imaginary parts of the data are present, however if
the data type is FLOAT, then it is assumed that only the
real part of the data is present and if the optional second
input image representing the imaginary part is not present
then the algorithm assumes the imaginary part of the data is
zero.
If the imaginary component of the input data is present as
the second input image, then the algorithm will use both the
real and imaginary parts as input to the FFT.
For a forward FFT, the input data is multiplied by (-
1)**(x+y) where (x,y) is the pixel coordinate. This has the
effect of shifting the frequency domain result so that the
DC component is at (N/2,N/2) rather than (0,0). For the
inverse FFT case, the data is multiplied by (-1)**(x+y)
AFTER the FFT processing, accounting for the fact that the
input frequency domain data was center-shifted by the for-
ward FFT. The center-shifted frequency domain representation
is much easier to visualize and filter than it would be if
not shifted. For more information on the shifting teqch-
nique, see R.C. Gonsalez and P. Wintz, "Digital Image Pro-
cessing, 2nd ed, sec 3.2.2, p. 77. (1987). The center-
shifting should really be an option.
For the forward FFT, there is no scaling on the data. For
the inverse FFT, the data is scaled by 1/(N*n). Thus, to
generate a sinewave of amplitude 1.0 for a 64x64 complex
image to be handed to the inverse FFT, there should be two
impulses at conjugate locations (symmetric about the center
of the image) each with amplitude 0.5/(64*64). Why 0.5? It's
because each impulse carries half of the power! The scaling
should really be an option, but it currently is not (perhaps
in a future patch).
This routine does not modify the input images.
The routine returns a 1 on success or a 0 on failure.
vfft(1), intro(3), vipl(3), verror(3), vutils(3)
lvfft(3),lvlpf(3),lvspectra(3)
RESTRICTIONS
vfft will only work on single band images of data type
FLOAT or COMPLEX.
Scott Wilson
COPYRIGHT
Copyright 1991, University of New Mexico. All rights
reserved.
*********************************************************************************
Documentation for avs module vfht
INPUT
1. img - a pointer to an xvimage structure containing
the image to be transformed
2. inv_flag - if set this flag indicates that an
inverse transform should be performed, otherwise a for-
ward transform is executed.
OUTPUT
1. img - the input image is overwritten and the output
is returned in its place. Be careful not to overwrite
important data.
vfht returns 1 upon success and 0 on failure.
DESCRIPTION
vfht vfht -i input.image -o hadamard.domain.image
This command performs a fast hadamard transform on the image
contained in the viff file "input.image" and returns the
output in another viff file called "hadamard.domain.image".
If your input image had dimensions 4 row by 4 columns, and
the image had a constant value as shown below
input image = { 1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1,
1, 1, 1, 1 }
The output would be this
output image = { 1, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0 }
Because the input image was simply the first of the Hadamard
basis functions with magnitude = 1.
The Following references were used in creating this
program :
1. "Digital Image Processing, Second Edition"
Rafael C. Gonzalex
Paul Wintz
Addison-Wesley Publishing Company, Reading Mas-
sachusetts, 1987
2. "The C User's Journal", July 1989, "The Fast Walsh
Transform", p101 .br
Ian AshDown
SEE ALSO
vfht(1), intro(3), vipl(3), verror(3), vutils(3) ldfht(3)
RESTRICTIONS
vfht only works on images of type VFF_TYP_FLOAT. The
dimensions of the input image must both be non-zero powers
of two. Images with maps or explicit location data are not
allowed.
AUTHOR
Per Lysne
COPYRIGHT
Copyright 1991, University of New Mexico. All rights
reserved.
*********************************************************************************
Documentation for avs module vmpp
INPUT
image is a pointer to the xvimage structure used as
the input image
k selects the information type:
1 - Magnitude
2 - Log(magnitude+1.0)
3 - Power
4 - Log(power+1.0)
5 - Phase
OUTPUT
Return Value: 1 on success, 0 on failure
DESCRIPTION
vmpp computes various representations of COMPLEX image
data.
The output of vmpp is always of type FLOAT and must be
scaled as necessary using vconvert(1) of vscale(1).
The available information types (selected by the -k argu-
ment) are:
1 - Magnitude
2 - Log(magnitude+1.0)
3 - Power
4 - Log(power+1.0)
5 - Phase
Note that image is used for both the input xvimage struc-
ture and the resulting output xvimage structure. This is
done to save space, but you must be careful not to overwrite
important data.
SEE ALSO
vmpp(1), intro(3), vipl(3), verror(3), vutils(3)
RESTRICTIONS
vmpp works only on single band COMPLEX images.
AUTHOR
Scott Wilson
COPYRIGHT
Copyright 1992, University of New Mexico. All rights
reserved.
*********************************************************************************