InferoTemporalHmax.H

Go to the documentation of this file.
00001 /*!@file Neuro/InferoTemporalHmax.H Object recognition module */
00002 
00003 // //////////////////////////////////////////////////////////////////// //
00004 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the //
00005 // 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: Laurent Itti <itti@usc.edu>
00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Neuro/InferoTemporalHmax.H $
00035 // $Id: InferoTemporalHmax.H 14157 2010-10-22 00:54:14Z dparks $
00036 //
00037 
00038 #ifndef INFEROTEMPORALHMAX_H_DEFINED
00039 #define INFEROTEMPORALHMAX_H_DEFINED
00040 
00041 #include "Component/ModelComponent.H"
00042 #include "Component/ModelParam.H"
00043 #include "Neuro/InferoTemporal.H"
00044 #include "HMAX/HmaxFL.H"
00045 #include "Learn/SVMObject.H"
00046 #include "Neuro/SVMClassifierModule.H"
00047 class Brain;
00048 
00049 namespace nub { template <class T> class ref; }
00050 
00051 
00052 // ######################################################################
00053 //! Inferotemporal interface using HMAX with feature learning
00054 /*! Model of the Inferior Temporal Cortex utilizing HMAX object recognition */
00055 class InferoTemporalHmax : public InferoTemporal
00056 {
00057 
00058 public:
00059   //! Constructor
00060   InferoTemporalHmax(OptionManager& mgr,
00061                     const std::string& descrName = "Infero Temporal HMAX",
00062                     const std::string& tagName = "InferoTemporalHmax");
00063 
00064   virtual std::vector<float> calculateFeatureVector(Image<float> img);
00065   virtual SVMObject determineLabel(Image<float> objImg,int id=-1, std::string name="");
00066   void writeOutFeatureVector(std::vector<float> featureVector, int id);
00067 
00068   //! Destructor
00069   virtual ~InferoTemporalHmax();
00070 
00071 protected:
00072   //! Object recognition
00073   virtual void attentionShift(SimEventQueue& q, const Point2D<int>& location);
00074   virtual float** _createFeatureVector();
00075   virtual void _freeFeatureVector(float **c2Res);
00076   virtual std::vector<float> _convertFeatureVector(float **c2Res);
00077 
00078 protected:
00079   OModelParam<std::string> itsHMAXStoredPatchesDir;   //!< dir of stored patches
00080   OModelParam<std::string> itsHMAXFeatureVectorFileName;    //!< File to output HMAX feature vectors
00081   OModelParam<bool>        itsHMAXDisableClassifier; //!< whether to disable support for the internal classifier
00082   InputFrame itsInputFrame;
00083   HmaxFL itsHmax;
00084   rutz::shared_ptr<SVMClassifierModule> itsClassifier;
00085 
00086   //! (re-)initialization - load object database
00087   virtual void start1();
00088 
00089   //! destruction - save object database
00090   virtual void stop1();
00091 
00092 };
00093 
00094 #endif
00095 
00096 
00097 // ######################################################################
00098 /* So things look consistent in everyone's emacs... */
00099 /* Local Variables: */
00100 /* indent-tabs-mode: nil */
00101 /* End: */
00102 
Generated on Sun May 8 08:05:24 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3