32 #include <Image/FFT2D_free.hh>
33 #include <Base/Image/Image.hh>
34 #include <Base/Image/ImageIO.hh>
35 #include <Base/Image/ImageConvert.hh>
36 #include <Base/Debug/TimeMeasure.hh>
42 int main(
int argc,
char *argv[])
48 im1grey.
Init(160,120,1);
52 if (ImageIO::Load(argv[1], im1)!=0){
53 BIASERR(
"error loading image "<<argv[1]);
56 ImageConvert::ToGrey(im1,im1grey);
60 ImageIO::Save(
"FFT2D_free_Grey1",im1grey);
76 cout <<
"FFT Forward took [ms] :"<<StopWatch.
GetRealTime()/1000/100<<endl;;
77 ImageIO::Save(
"FFT2D_free_Spectrum_complex",complex);
85 cout <<
"FFT GetValue took [ms] :"<<StopWatch.
GetRealTime()/1000<<endl;;
86 ImageIO::Save(
"FFT2D_free_Spectrum_value",value);
89 ImageIO::Save(
"FFT2D_free_Spectrum_normalized",complex);
95 ImageConvert::ToRGB(res, resRGB);
96 ImageIO::Save(
"FFT2D_free_Reverse",resRGB);
unsigned int GetWidth() const
unsigned int GetHeight() const
void FillImageWithXValue()
fills image with value depending on x coordinate
double GetRealTime() const
return real time (=wall time clock) in usec JW For Win32: real-time is measured differently from user...
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
void GetMagnitude(const Image< float > &ComplexIn, Image< float > &value)
take the spectrum image (2-channel) and compute the absolute value for each pixel ...
Wrapper to the fftpack library from netlib (see fftpack/fft.c), implementing the fft (Fast Fourier Tr...
void Reverse(const Image< float > &ComplexIn, Image< StorageType > &res)
void Forward(const Image< StorageType > &in, Image< float > &ComplexOut)
apply FFT on
class TimeMeasure contains functions for timing real time and cpu time.