src/fft.h

00001 
00002 
00003 
00004 
00005 
00006 
00007 #ifndef __IMAGER_FFT_H__
00008 #define __IMAGER_FFT_H__
00009 
00010 #include "defs.h"
00011 
00012 
00013 /* A 2x2 matrix of Fourier filter coefficients. Since a Fourier filter may be
00014         complex, we need to be able to perform the following operation:
00015         Assume the matrix is    |  a -jb |
00016                                                         | jc   d |
00017         and we multiply the original complex number x + jy with that matrix, 
00018         then our result is
00019                 Real part: x' = ax + by
00020                 Imag part: y' = cx + dy
00021 
00022         In the case of a filter that only influences magnitude and not phase,
00023         we would set b=c=0 and a=d=H where H is the transfer function magnitude
00024         Another example. The first derivative is H(f) = -jf , so we change
00025         the phase.For this filter, we'd use a=0, b=f, c=-f, d=0
00026 */
00027 
00028 typedef struct
00029 {
00030         float A[4];
00031 
00032 }
00033 ffilt_mat;
00034 
00035 
00036 
00037 
00038 /* The callback function pointer */
00039 
00040 ffilt_mat neutral_fft_filter (int x, int y, float a, float b, float c, float d);
00041 ffilt_mat fft_homomorphic_hp (int x, int y, float a, float b, float c, float d);
00042 ffilt_mat fft_gaussian_lp    (int x, int y, float a, float b, float c, float d);
00043 ffilt_mat fft_butterworth_lp (int x, int y, float a, float b, float c, float d);
00044 ffilt_mat fft_first_deriv    (int x, int y, float a, float b, float c, float d);
00045 
00046 
00047 void fft2d (image_type* img, int z);
00048 void ifft2d (image_type* img);
00049 void dht2d (image_type* img, int z, int direction);
00050 void fft_main (int direction);
00051 
00052 void fourier_filter (image_type* img, int z, gpointer func, int uselog, float a, float b, float c, float d);
00053 void fftfilt_go (image_type* img, int filt, float a, float b, float c, float d);
00054 void fftfilt_log_go (image_type* img, int filt, float a, float b, float c, float d);
00055 
00056 void fourierfilt_main (image_type* img);
00057 
00058 void fft_1d_filter (float *databuf, int npoints, gpointer func, int flags, float a, float b, float c, float d);
00059 
00060 #endif

Generated on Sat Nov 15 23:24:49 2008 for Crystal Image by  doxygen 1.5.3