IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 7, 2007, 6:17:58 PM (19 years ago)
Author:
Paul Price
Message:

Reworked image convolution (split direct and FFT methods into separate functions) and FFT functions. psVectorFFT needs a bit more work to clean up the N/2 issues from FFTW's r2c and c2r.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fft/psImageFFT.h

    r11248 r11703  
    1 /* @file  psImageFFT.h
    2  * @brief Contains FFT transform related functions for psImage
    3  *
    4  * @author Robert DeSonia, MHPCC
    5  *
    6  * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    7  * @date $Date: 2007-01-23 22:47:22 $
    8  * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    9  */
     1/// @file  psImageFFT.h
     2/// @brief Contains FFT transform related functions for psImage
     3///
     4/// @author Paul Price, IfA
     5/// @author Robert DeSonia, MHPCC
     6///
     7/// @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     8/// @date $Date: 2007-02-08 04:17:58 $
     9/// Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     10///
    1011
    1112#ifndef PS_IMAGE_FFT_H
     
    1314
    1415#include "psImage.h"
    15 #include "psVectorFFT.h"               // for psFFTFlags
    1616
    1717/// @addtogroup MathOps Mathematical Operations
    1818/// @{
    1919
    20 /** Forward and reverse FFT calculations.
    21  *
    22  *  This takes as input the image of interest (in) and the direction
    23  *  (direction), which is specified by an enumerated type psFftDirection.
    24  *  The input image may be of type psF32 or psC32, the result is always
    25  *  psC32. If the input vector is psF32, the direction must be forward.
    26  *
    27  *  @return psImage* the FFT transformation result
    28  */
    29 psImage* psImageFFT(
    30     psImage* out,                      ///< a psImage to recycle.  If NULL, a new psImage is made.
    31     const psImage* image,              ///< the psImage to apply transform to
    32     psFFTFlags direction               ///< the direction of the transform
    33 );
     20/// Forward FFT of an image
     21///
     22/// Applies a forward FFT (exponent -1), with the result returned in both real and imaginary parts.  The FFT
     23/// is not normalised (a forward followed by a reverse is the original scaled by the total number of pixels).
     24/// The FFT takes advantage of the fact that the input is purely real; hence the output number of columns is
     25/// numCols/2 + 1 (with division rounding down).  Only implemented for F32 input.
     26bool psImageForwardFFT(psImage **real,  ///< Real part of FFT
     27                       psImage **imag,  ///< Imaginary part of FFT
     28                       const psImage *in///< Input image (F32)
     29    );
    3430
    35 /** extract the real portion of a complex image
    36  *
    37  *  @return psImage*   real portion of the input image.
    38  */
    39 psImage* psImageReal(
    40     psImage* out,                      ///< a psImage to recycle.  If NULL, a new psImage is made.
    41     const psImage* in                  ///< the psImage to extract real portion from
    42 );
     31/// Backward FFT of an image
     32///
     33/// Applies a backward FFT (exponent +1) from the real and imaginary parts with the (purely) real result
     34/// returned.  The FFT is not normalised (a forward followed by a reverse is the original scaled by the total
     35/// number of pixels).  The FFT takes advantage of the fact that the output will be purely real; hence the
     36/// input number of columns is numCols/2 + 1 (with division rounding down); to manage the redundancy (is the
     37/// original number of columns even or odd?), we need the original number of columns (the number of columns of
     38/// the image that was input to psImageForwardFFT) to be provided.  Only implemented for F32 input.
     39bool psImageBackwardFFT(psImage **out,///< Output image
     40                        const psImage *real, ///< Real input (F32)
     41                        const psImage *imag, ///< Imaginary input (F32)
     42                        int origCols    ///< Original number of columns
     43    );
    4344
    44 /** extract the imaginary portion of a complex image
    45  *
    46  *  @return psImage*   imaginary portion of the input image.
    47  */
    48 psImage* psImageImaginary(
    49     psImage* out,                      ///< a psImage to recycle.  If NULL, a new psImage is made.
    50     const psImage* in                  ///< the psImage to extract imaginary portion from
    51 );
    5245
    53 /** creates a complex image from separate real and imaginary plane images
    54  *
    55  *  @return psImage*   resulting complex image
    56  */
    57 psImage* psImageComplex(
    58     psImage* out,                      ///< a psImage to recycle.  If NULL, a new psImage is made.
    59     const psImage* real,               ///< the real plane image
    60     const psImage* imag                ///< the imaginary plane image
    61 );
     46/// Power spectrum of an image
     47///
     48/// Generates the power spectrum of an image.  Only implemented for F32 input.
     49psImage* psImagePowerSpectrum(psImage *out, const psImage *in);
    6250
    63 /** computes the complex conjugate of an image
    64  *
    65  *  @return psImage*   the complex conjugate of the 'in' image
    66  */
    67 psImage* psImageConjugate(
    68     psImage* out,                      ///< a psImage to recycle.  If NULL, a new psImage is made.
    69     const psImage* in                  ///< the psImage to compute conjugate of
    70 );
    71 
    72 /** computes the power spectrum of an image
    73  *
    74  *  @return psImage*   the power spectrum of the 'in' image
    75  */
    76 psImage* psImagePowerSpectrum(
    77     psImage* out,                      ///< a psImage to recycle.  If NULL, a new psImage is made.
    78     const psImage* in                  ///< the psImage to power spectrum of
    79 );
     51/// Multiply complex images
     52///
     53/// The input images are the real and imaginary parts of each of two images.  The real and imaginary parts
     54/// of the output image are returned.  Only implemented for F32 input.
     55bool psImageComplexMultiply(psImage **outReal, ///< Real part of output
     56                            psimage **outImag, ///< Imaginary part of output
     57                            const psImage *in1Real, ///< Real part of input 1
     58                            const psImage *in1Imag, ///< Imaginary part of input 1
     59                            const psImage *in2Real, ///< Real part of input 2
     60                            const psImage *in2Imag ///< Imaginary part of input 2
     61    );
    8062
    8163/// @}
Note: See TracChangeset for help on using the changeset viewer.