Example for using the fast fourier Transform (FFT)
- Author
- MIP
#include <Image/FFT2D_free.hh>
#include <Base/Image/Image.hh>
#include <Base/Image/ImageIO.hh>
#include <Base/Image/ImageConvert.hh>
#include <Base/Debug/TimeMeasure.hh>
using namespace std;
using namespace BIAS;
int main(int argc, char *argv[])
{
if (argc<2){
}
else {
if (ImageIO::Load(argv[1], im1)!=0){
BIASERR("error loading image "<<argv[1]);
return -2;
}
ImageConvert::ToGrey(im1,im1grey);
}
ImageIO::Save("FFT2D_free_Grey1",im1grey);
cout <<
"FFT Forward took [ms] :"<<StopWatch.
GetRealTime()/1000/100<<endl;;
ImageIO::Save("FFT2D_free_Spectrum_complex",complex);
cout <<
"FFT GetValue took [ms] :"<<StopWatch.
GetRealTime()/1000<<endl;;
ImageIO::Save("FFT2D_free_Spectrum_value",value);
ImageIO::Save("FFT2D_free_Spectrum_normalized",complex);
ImageConvert::ToRGB(res, resRGB);
ImageIO::Save("FFT2D_free_Reverse",resRGB);
return 0;
}