00001 /*!@file */ 00002 // //////////////////////////////////////////////////////////////////// // 00003 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the // 00004 // University of Southern California (USC) and the iLab at USC. // 00005 // See http://iLab.usc.edu for information about this project. // 00006 // //////////////////////////////////////////////////////////////////// // 00007 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00008 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00009 // in Visual Environments, and Applications'' by Christof Koch and // 00010 // Laurent Itti, California Institute of Technology, 2001 (patent // 00011 // pending; application number 09/912,225 filed July 23, 2001; see // 00012 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00013 // //////////////////////////////////////////////////////////////////// // 00014 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00015 // // 00016 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00017 // redistribute it and/or modify it under the terms of the GNU General // 00018 // Public License as published by the Free Software Foundation; either // 00019 // version 2 of the License, or (at your option) any later version. // 00020 // // 00021 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00022 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00023 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00024 // PURPOSE. See the GNU General Public License for more details. // 00025 // // 00026 // You should have received a copy of the GNU General Public License // 00027 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00028 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00029 // Boston, MA 02111-1307 USA. // 00030 // //////////////////////////////////////////////////////////////////// // 00031 // 00032 // Primary maintainer for this file: Christian Siagian <siagian@usc.edu> 00033 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Robots/Beobot2/Localization/Beobot2GistSalMaster.H $ 00034 // $Id: Beobot2GistSalMaster.H 12962 2010-03-06 02:13:53Z irock $ 00035 // 00036 00037 #ifndef BEOBOT2GISTSALMASTERI_H 00038 #define BEOBOT2GISTSALMASTERI_H 00039 00040 #include "Component/ModelComponent.H" 00041 #include "Component/ModelParam.H" 00042 #include "Media/FrameSeries.H" 00043 #include "Transport/FrameInfo.H" 00044 #include "Raster/GenericFrame.H" 00045 #include "Image/Image.H" 00046 #include "GUI/XWinManaged.H" 00047 #include "GUI/ImageDisplayStream.H" 00048 #include "Image/Image.H" 00049 #include "Image/Pixels.H" 00050 #include "Robots/RobotBrain/RobotBrainComponent.H" 00051 00052 #include "Ice/RobotBrainObjects.ice.H" 00053 #include "Ice/BeobotEvents.ice.H" 00054 #include "Ice/IceImageUtils.H" 00055 #include <IceUtil/Thread.h> 00056 00057 00058 #include "Beobot/BeobotBrainMT.H" 00059 #include "Beobot/beobot-GSnav-def.H" 00060 00061 #include "Media/MediaOpts.H" 00062 00063 class Beobot2GistSalMasterI : public RobotBrainComponent 00064 { 00065 public: 00066 00067 Beobot2GistSalMasterI(OptionManager& mgr, 00068 const std::string& descrName = "Beobot2GistSalMaster", 00069 const std::string& tagName = "Beobot2GistSalMaster"); 00070 00071 ~Beobot2GistSalMasterI(); 00072 00073 //! Get started. See ModelComponent. 00074 virtual void start1(); 00075 00076 virtual void evolve(); 00077 00078 //!Get a message 00079 virtual void updateMessage(const RobotSimEvents::EventMessagePtr& eMsg, 00080 const Ice::Current&); 00081 00082 virtual void registerTopics(); 00083 00084 inline nub::soft_ref<InputFrameSeries> getIfs(); 00085 inline void setInputFrameRate(uint64 inputFrameRate); 00086 00087 private: 00088 nub::soft_ref<InputFrameSeries> itsIfs; // input image 00089 nub::soft_ref<BeobotBrainMT> itsBbmt; // saliency and gist 00090 rutz::shared_ptr<XWinManaged> itsMwin; // display window 00091 Image<PixRGB<byte> > itsDisp; // display image 00092 00093 ImageSet<float> itsCmap; // conspicuity map 00094 std::vector<Point2D<int> > itsClmpt; // currently followed landmarks 00095 std::vector<Point2D<int> > itsNlmpt; // currently searched landmarks 00096 00097 // frame number and timing related 00098 int itsCurrMessageID; 00099 uint64 itsInputFrameRate; // in micro-seconds 00100 bool itsNextFrameFlag; 00101 Timer itsInputTimer; 00102 std::vector<float> itsTimes; 00103 }; 00104 00105 // ###################################################################### 00106 // Implementation for Beobot2GisSalMaster inline functions 00107 // ###################################################################### 00108 inline nub::soft_ref<InputFrameSeries> Beobot2GistSalMasterI::getIfs() 00109 { return itsIfs; } 00110 00111 inline void Beobot2GistSalMasterI::setInputFrameRate(uint64 inputFrameRate) 00112 { itsInputFrameRate = inputFrameRate; } 00113 00114 #endif 00115 00116 // ###################################################################### 00117 /* So things look consistent in everyone's emacs... */ 00118 /* Local Variables: */ 00119 /* indent-tabs-mode: nil */ 00120 /* End: */