Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FFT2D_free.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003, 2004 (see file CONTACTS for details)
5 Multimediale Systeme der Informationsverarbeitung
6 Institut fuer Informatik
7 Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 #ifndef __2DFFT_free_hh__
27 #define __2DFFT_free_hh__
28 
29 #include <bias_config.h>
30 #include <Base/Image/Image.hh>
31 
32 
33 namespace BIAS {
34 
35  /** \class FFT2D_free
36  * \brief Wrapper to the fftpack library from netlib (see fftpack/fft.c),
37  * implementing the fft (Fast Fourier Transform) for images. This is a
38  * replacement for FFT2D which is usable under the GPL.
39  * \author evers
40  * \date 2009 */
41  template <class StorageType>
42  class BIASImage_EXPORT FFT2D_free
43  {
44  public:
45  FFT2D_free();
46  virtual ~FFT2D_free();
47 
48  void Init(int sizex,int sizey);
49  /// apply FFT on @param in, result is 2-channel image with real an
50  /// img. Result ist _not_normalized.
51  void Forward(const Image<StorageType> &in, Image<float> &ComplexOut);
52 
53 
54  /// apply normalisation on spectrum image, which is float-type
55  void Normalize(Image<float> &Image);
56 
57  void Reverse(const Image<float> &ComplexIn, Image<StorageType> &res);
58 
59  /// take the spectrum image (2-channel) and compute the absolute value for each pixel
60  void GetMagnitude(const Image<float> &ComplexIn, Image<float> &value);
61 
62  protected:
63 
64  void ComplexColumnToWorkArray1_(const Image<float> &ComplexImg,
65  unsigned int col);
66  void ComplexRowToWorkArray0_(const Image<float> &ComplexImg,
67  unsigned int row);
68 
69  void WorkArray0ToComplexRow_(Image<float> &ComplexImg,unsigned int row);
70  void WorkArray1ToComplexColumn_(Image<float> &ComplexImg,unsigned int col);
71 
72  // one set of work- and tmparray for each dimension
73  long int WorkSize0_,WorkSize1_;
74  float *WorkArray0_, *WorkArray1_;
75  float *TmpArray0_,*TmpArray1_;
76  long int TmpArraySize0_,TmpArraySize1_;
77  unsigned long long int Normalize_ ;
78  }; // class
79 
80 
81 } // namespace
82 
83 #endif
long int TmpArraySize1_
Definition: FFT2D_free.hh:76
unsigned long long int Normalize_
Definition: FFT2D_free.hh:77
The image template class for specific storage types.
Definition: Image.hh:78
float * TmpArray1_
Definition: FFT2D_free.hh:75
long int WorkSize1_
Definition: FFT2D_free.hh:73
Wrapper to the fftpack library from netlib (see fftpack/fft.c), implementing the fft (Fast Fourier Tr...
Definition: FFT2D_free.hh:42
float * WorkArray1_
Definition: FFT2D_free.hh:74