IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2008, 12:44:56 PM (18 years ago)
Author:
Paul Price
Message:

Optimising psImageConvolveFFT. Made a couple of optimisations: 1. Moved code into psImageFFT.c, so I can use FFTW directly. FFTW, through its 'advanced interface' allows two FFTs to be performed at the same time and 'the resulting plans can often be faster than calling FFTW multiple times for the individual transforms' (FFTW 3.1.2 manual, p30). 2. The convolved image needs to be normalised because FFTW doesn't take out the sqrt(N) factors in the FFT. Instead of multiplying the entire convolved image, we can multiply the much smaller number of pixels in the kernel. Tested this code with tap_psImageConvolve2 and it seems to work. Running convolutionBench unoptimised on mithrandir produces times that are comparable to what I got a while back running optimised. Running it optimized on alala produces speed-ups ranging from 25 to 350%.

File:
1 edited

Legend:

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

    r11704 r17320  
    55/// @author Robert DeSonia, MHPCC
    66///
    7 /// @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    8 /// @date $Date: 2007-02-08 04:23:57 $
     7/// @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     8/// @date $Date: 2008-04-04 22:44:56 $
    99/// Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1010///
     
    1414
    1515#include "psImage.h"
     16#include "psImageConvolve.h"
    1617
    1718/// @addtogroup MathOps Mathematical Operations
     
    6162    );
    6263
     64/// Convolve an image with a kernel, using the FFT
     65///
     66/// This is appropriate for larger kernels, where the direct convolution is slow.  The input image and kernel
     67/// are suitably padded to avoid wrap-around effects.
     68psImage *psImageConvolveFFT(
     69    psImage *out,                       ///< Output image, or NULL
     70    const psImage *in,                  ///< Image to convolve
     71    const psImage *mask,                ///< Corresponding mask
     72    psMaskType maskVal,                 ///< Value to mask
     73    const psKernel *kernel              ///< kernel to colvolve with
     74);
     75
    6376/// @}
    6477#endif // #ifndef PS_IMAGE_FFT_H
Note: See TracChangeset for help on using the changeset viewer.