Main Page | Class Hierarchy | Class List | File List | Class Members

fourier.h

00001 /* 00002 * This file is part of libCP 00003 * FILE: fourier.h 00004 * AUTHOR: Harald Studer (hs@lexip.ch) 00005 * 00006 * 00007 * Copyright (c) 2004, The libCP project 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your opinion) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; see the file COPYING. If not, write to 00021 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00022 * Boston, MA 02111-1307, USA. 00023 */ 00024 00025 #ifndef _LIBCP_FOURIER_H_ 00026 #define _LIBCP_FOURIER_H_ 00027 00028 #include <cstdlib> 00029 #include <iostream> 00030 00031 using namespace std; 00032 00033 #include "globals.h" 00034 #include "image.h" 00035 #include "compleximage.h" 00036 00037 namespace LIBCP{ 00038 00045 class Fourier 00046 { 00047 public: 00048 static int fastFourierTransform( ComplexImage* complex, Image* src ); 00049 static int inverseFastFourierTransform( Image* dst, ComplexImage* complex ); 00050 static int shiftFFT( ComplexImage* dst ,ComplexImage* src ); 00051 static int shiftFFT( ComplexImage* &img ); 00052 static void resizeToPowerOf2( Image* &img ); 00053 static int filterFrequencySpaceLowpass( ComplexImage* &dst, 00054 ComplexImage* &src, 00055 double cut_off ); 00056 static int filterFrequencySpaceHighpass( ComplexImage* &dst, 00057 ComplexImage* &src, 00058 double cut_off ); 00059 static int filterFrequencySpaceBandpass( ComplexImage* &dst, 00060 ComplexImage* &src, 00061 double lower_cut_off, 00062 double upper_cut_off ); 00063 static int filterFrequencySpaceBandstop( ComplexImage* &dst, 00064 ComplexImage* &src, 00065 double lower_cut_off, 00066 double upper_cut_off ); 00067 static int smothedFilterFrequencySpace( Image* dst, Image* src ); /*TODO*/ 00068 static int orientedFilterFrequencySpace( Image* dst, Image* src ); /*TODO*/ 00069 static int scaleUpOrDown( Image* dst, Image* src ); /*TODO*/ 00070 static int conjugateComplex( ComplexImage* dst, ComplexImage* src ); 00071 static int complexMultiplication( ComplexImage* dst, ComplexImage* src ); /*TODO*/ 00072 static int complexDivision( Image* dst, Image* src ); /*TODO*/ 00073 static int iterativeDeconvolution( Image* dst, Image* src ); /*TODO*/ 00074 static int wienerFilterForRestoration( Image* dst, Image* src ); /*TODO*/ 00075 00076 private: 00077 static void fft( Complex* x, Complex* twiddle, int N ); 00078 static void Twiddle( Complex* x, int N ); 00079 static void iTwiddle( Complex* x, int N ); 00080 static void createComplexFromImage( Image* img, ComplexImage* complex ); 00081 static void createImageFromComplex( Image* img, ComplexImage* complex, 00082 bool normalize ); 00083 //static bool powerOf2( double number, int &m ); 00084 00085 }; //end of class Fourier 00086 } //end of namespace LIBCP 00087 00088 #endif //_LIBCP_FOURIER_H_

Generated on Wed May 26 16:43:53 2004 for libcp by doxygen 1.3.7