00001 #ifndef FFTWEXT_H
00002 #define FFTWEXT_H
00003
00004 extern "C"
00005 {
00006
00007 #include <fftw3.h>
00008 }
00009
00010 #include <opencv/cv.hpp>
00011
00012 #define c_re(c) ((c)[0])
00013 #define c_im(c) ((c)[1])
00014
00015 namespace seemicro
00016 {
00017
00024 inline CvScalar toColorScalar(double v, int (*above_threshold)(double) = NULL);
00025
00034 void IplImage2fftw_real(IplImage *img, double* ff, int ffwidth = 0, int ffheight = 0);
00035
00039 void doubles2IplImage(double scale, IplImage *img, double* ff,
00040 int ffwidth = 0, int ffheight = 0, int (*above_threshold)(double) = NULL);
00041
00045 void fftw_complex2IplImages(fftw_complex *ff, IplImage *outR, IplImage *outI);
00046
00051 void fftw_complex2IplImageMagnitude(fftw_complex *ff, IplImage *magnitude);
00052
00056 void fftw_complex_multiply(fftw_complex *a, fftw_complex *b, int w, int h);
00057
00061 void fftw_complex_multiply_conjugate(fftw_complex *a, fftw_complex *b, int w, int h);
00062
00070 double try_mark_region(double *ff, int width, int height,
00071 int (*above_threshold)(double),
00072 int x, int y, int* x_max, int* y_max, double scale);
00073
00074 struct maximum { double v; int x,y; };
00075
00079 int find_maxima(struct maximum *maxima, int width, int height, double *ff,
00080 int (*above_threshold)(double), int max_maxima=1);
00081
00085 void findMaxPoint(int width, int height, double *ff, double threshold_value,
00086 maximum *max);
00087
00088 }
00089
00090 #endif