00001 /*!@file Neuro/InferoTemporal.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/InferoTemporal.H $ 00035 // $Id: InferoTemporal.H 10747 2009-02-03 08:24:04Z itti $ 00036 // 00037 00038 #ifndef INFEROTEMPORAL_H_DEFINED 00039 #define INFEROTEMPORAL_H_DEFINED 00040 00041 #include "Channels/InputFrame.H" 00042 #include "Component/ModelComponent.H" 00043 #include "Component/ModelParam.H" 00044 #include "Image/Pixels.H" 00045 #include "Image/Image.H" 00046 #include "Neuro/NeuroSimEvents.H" 00047 #include "SIFT/VisualObjectMatchAlgo.H" 00048 #include "Simulation/SimModule.H" 00049 00050 class VisualCortex; 00051 class VisualObjectDB; 00052 class Brain; 00053 00054 namespace nub { template <class T> class ref; } 00055 00056 // ###################################################################### 00057 //! Abstract inferotemporal interface 00058 class InferoTemporal : public SimModule 00059 { 00060 public: 00061 //! Constructor 00062 InferoTemporal(OptionManager& mgr, 00063 const std::string& descrName, 00064 const std::string& tagName); 00065 00066 //! Destructor 00067 virtual ~InferoTemporal(); 00068 00069 protected: 00070 //! Callback for when a new WTA winner is available 00071 SIMCALLBACK_DECLARE(InferoTemporal, SimEventWTAwinner); 00072 00073 //! Object recognition 00074 virtual void attentionShift(SimEventQueue& q, const Point2D<int>& location) = 0; 00075 }; 00076 00077 // ###################################################################### 00078 //! Do-nothing stub implementation of InferoTemporal 00079 class InferoTemporalStub : public InferoTemporal 00080 { 00081 public: 00082 //! Constructor 00083 InferoTemporalStub(OptionManager& mgr, 00084 const std::string& descrName = "Infero Temporal Stub", 00085 const std::string& tagName = "InferoTemporalStub"); 00086 00087 //! Destructor 00088 virtual ~InferoTemporalStub(); 00089 00090 protected: 00091 //! No-op stub 00092 virtual void attentionShift(SimEventQueue& q, const Point2D<int>& location); 00093 }; 00094 00095 // ###################################################################### 00096 //! InferoTemporalStd 00097 /*! Model of the Inferior Temporal Cortex utilizing SIFT object 00098 recognition. */ 00099 class InferoTemporalStd : public InferoTemporal 00100 { 00101 public: 00102 //! Constructor 00103 InferoTemporalStd(OptionManager& mgr, 00104 const std::string& descrName = "Infero Temporal Std", 00105 const std::string& tagName = "InferoTemporalStd"); 00106 00107 //! Destructor 00108 virtual ~InferoTemporalStd(); 00109 00110 protected: 00111 //! Object recognition 00112 virtual void attentionShift(SimEventQueue& q, const Point2D<int>& location); 00113 00114 protected: 00115 OModelParam<bool> itsUseAttention; //!< attention modulated reco 00116 OModelParam<std::string> itsObjectDatabaseFile; //!< obj knowledgebase file 00117 OModelParam<bool> itsTrainObjectDB; //!< train the database 00118 OModelParam<bool> itsPromptUserTrainDB; //!< prompt before training 00119 OModelParam<bool> itsMatchObjects; //!< match new objects 00120 OModelParam<int> itsRecogMinMatch; //!< min matches for recog 00121 OModelParam<VisualObjectMatchAlgo> itsMatchingAlg; //!< matching algo to use 00122 00123 rutz::shared_ptr<VisualObjectDB> itsObjectDB; //!< our object database 00124 00125 InputFrame itsInputFrame; 00126 00127 //! (re-)initialization - load object database 00128 virtual void start1(); 00129 00130 //! destruction - save object database 00131 virtual void stop1(); 00132 }; 00133 00134 #endif 00135 00136 // ###################################################################### 00137 /* So things look consistent in everyone's emacs... */ 00138 /* Local Variables: */ 00139 /* indent-tabs-mode: nil */ 00140 /* End: */