00001 /*!@file Neuro/GistEstimatorFFT.H Extract gist of image using the Fourier Transform */ 00002 00003 // //////////////////////////////////////////////////////////////////// // 00004 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2005 // 00005 // by the University of Southern California (USC) and the iLab at USC. // 00006 // See http://iLab.usc.edu for information about this project. // 00007 // //////////////////////////////////////////////////////////////////// // 00008 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00009 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00010 // in Visual Environments, and Applications'' by Christof Koch and // 00011 // Laurent Itti, California Institute of Technology, 2001 (patent // 00012 // pending; application number 09/912,225 filed July 23, 2001; see // 00013 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00014 // //////////////////////////////////////////////////////////////////// // 00015 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00016 // // 00017 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00018 // redistribute it and/or modify it under the terms of the GNU General // 00019 // Public License as published by the Free Software Foundation; either // 00020 // version 2 of the License, or (at your option) any later version. // 00021 // // 00022 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00023 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00024 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00025 // PURPOSE. See the GNU General Public License for more details. // 00026 // // 00027 // You should have received a copy of the GNU General Public License // 00028 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00029 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00030 // Boston, MA 02111-1307 USA. // 00031 // //////////////////////////////////////////////////////////////////// // 00032 // 00033 // Primary maintainer for this file: Christian Siagian <siagian at usc dot edu> 00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Neuro/GistEstimatorFFT.H $ 00035 // $Id: GistEstimatorFFT.H 11797 2009-10-06 05:35:58Z kai $ 00036 // 00037 00038 // ###################################################################### 00039 /*! Extract gist of image using the Fourier Transform */ 00040 00041 #ifndef NEURO_GISTESTIMATORFFT_H_DEFINED 00042 #define NEURO_GISTESTIMATORFFT_H_DEFINED 00043 00044 #include "Image/Image.H" 00045 #include "Neuro/GistEstimator.H" 00046 #include "Neuro/VisualCortex.H" 00047 #include "Image/FFTWWrapper.H" 00048 #include "GUI/XWinManaged.H" 00049 00050 class GistEstimatorFFT : public GistEstimatorAdapter 00051 { 00052 public: 00053 //! Constructor 00054 GistEstimatorFFT(OptionManager& mgr, 00055 const std::string& descrName = "GistEstimatorFFT", 00056 const std::string& tagName = "GistEstimatorFFT"); 00057 00058 //! Destructor 00059 virtual ~GistEstimatorFFT(); 00060 00061 //! get the gist features 00062 void computeGistFeatureVector(Image<float> img); 00063 00064 //! visualization of the Fourier Transform of the input image 00065 Image<float> getFftImage(); 00066 00067 //! return the gist feature values 00068 virtual Image<double> getGist(); 00069 00070 protected: 00071 //! Callback for when a new input (retina) frame is available 00072 SIMCALLBACK_DECLARE(GistEstimatorFFT, SimEventRetinaImage); 00073 00074 private: 00075 void setupFFTW(int w, int h); 00076 void setupGaborMask(int w, int h); 00077 void fftCompute(Image<float> img, double **fftOut); 00078 00079 void computeFFTgabor(const float stddev, const float period, 00080 const float theta, uint w, uint h, 00081 double **gm); 00082 00083 Image<float> getFftImage(double **res, int w, int h); 00084 Image<float> normalize(Image<float> img); 00085 00086 //! gist feature vector 00087 Image<double> itsGistVector; 00088 00089 //! its FFTW wrappers 00090 FFTWWrapper *itsFftw; 00091 double *itsFftwBuffer; 00092 double **itsOutFftwBuffer; 00093 00094 double ****gaborMask; 00095 Image<float>** gaborMaskImg; 00096 float itsStddev; 00097 00098 Image<float> itsFftImage; 00099 XWinManaged* xw; 00100 }; 00101 00102 // ###################################################################### 00103 /* So things look consistent in everyone's emacs... */ 00104 /* Local Variables: */ 00105 /* indent-tabs-mode: nil */ 00106 /* End: */ 00107 00108 #endif // NEURO_GISTESTIMATORFFT_H_DEFINED