00001 /*!@file Neuro/GistEstimatorTexton.H */ 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: Manu Viswanathan <mviswana at usc dot edu> 00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Neuro/GistEstimatorTexton.H $ 00035 // $Id: GistEstimatorTexton.H 11104 2009-04-13 18:36:37Z lzc $ 00036 // 00037 00038 #ifndef NEURO_GISTESTIMATORTEXTON_H_DEFINED 00039 #define NEURO_GISTESTIMATORTEXTON_H_DEFINED 00040 00041 //------------------------------ HEADERS -------------------------------- 00042 00043 // Gist specific headers 00044 #include "Neuro/GistEstimator.H" 00045 00046 // Other INVT headers 00047 #include "Neuro/NeuroSimEvents.H" 00048 00049 // Standard C++ headers 00050 #include <string> 00051 00052 //------------------------- CLASS DEFINITION ---------------------------- 00053 00054 class GistEstimatorTexton : public GistEstimatorAdapter { 00055 public: 00056 //! Constructor 00057 GistEstimatorTexton(OptionManager& mgr, 00058 const std::string& descrName = "GistEstimatorTexton", 00059 const std::string& tagName = "GistEstimatorTexton") ; 00060 00061 static const uint NUM_ORIENTATIONS = 6 ; 00062 static const uint NUM_SCALES = 3 ; 00063 static const uint NUM_FILTERS = NUM_ORIENTATIONS * NUM_SCALES ; 00064 00065 typedef float PixelType ; 00066 typedef Image<PixelType> ImageType ; 00067 00068 //! Destructor 00069 virtual ~GistEstimatorTexton() ; 00070 00071 protected: 00072 //! Return the gist feature values 00073 Image<double> getGist() ; 00074 00075 // Texton-based gist computations require a "database" of universal 00076 // textons in place. 00077 static void setUniversalTextons(const ImageType*) ; 00078 00079 // Training related settings 00080 typedef void (*TrainingHook)(const ImageType&) ; 00081 void setTrainingHook(TrainingHook) ; 00082 00083 //! Callback for when new data is available from Visuc=alCortex 00084 SIMCALLBACK_DECLARE(GistEstimatorTexton, SimEventVisualCortexOutput); 00085 00086 private : 00087 Image<double> itsGistVector ; // gist feature vector 00088 static const ImageType* itsUniversalTextons ; 00089 TrainingHook itsTrainingHook ; 00090 } ; 00091 00092 //-------------------- INLINE FUNCTION DEFINITIONS ---------------------- 00093 00094 inline Image<double> GistEstimatorTexton::getGist() 00095 { 00096 return itsGistVector ; 00097 } 00098 00099 inline void 00100 GistEstimatorTexton:: 00101 setUniversalTextons(const GistEstimatorTexton::ImageType* U) 00102 { 00103 itsUniversalTextons = U ; 00104 } 00105 00106 inline void 00107 GistEstimatorTexton:: 00108 setTrainingHook(GistEstimatorTexton::TrainingHook H) 00109 { 00110 itsTrainingHook = H ; 00111 } 00112 00113 //----------------------------------------------------------------------- 00114 00115 /* So things look consistent in everyone's emacs... */ 00116 /* Local Variables: */ 00117 /* indent-tabs-mode: nil */ 00118 /* End: */ 00119 00120 #endif