00001 /*!@file Neuro/SimulationViewerEyeMvt2.H comparison between saliency and 00002 human eye movements */ 00003 00004 // //////////////////////////////////////////////////////////////////// // 00005 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2003 // 00006 // by the University of Southern California (USC) and the iLab at USC. // 00007 // See http://iLab.usc.edu for information about this project. // 00008 // //////////////////////////////////////////////////////////////////// // 00009 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00010 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00011 // in Visual Environments, and Applications'' by Christof Koch and // 00012 // Laurent Itti, California Institute of Technology, 2001 (patent // 00013 // pending; application number 09/912,225 filed July 23, 2001; see // 00014 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00015 // //////////////////////////////////////////////////////////////////// // 00016 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00017 // // 00018 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00019 // redistribute it and/or modify it under the terms of the GNU General // 00020 // Public License as published by the Free Software Foundation; either // 00021 // version 2 of the License, or (at your option) any later version. // 00022 // // 00023 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00024 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00025 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00026 // PURPOSE. See the GNU General Public License for more details. // 00027 // // 00028 // You should have received a copy of the GNU General Public License // 00029 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00030 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00031 // Boston, MA 02111-1307 USA. // 00032 // //////////////////////////////////////////////////////////////////// // 00033 // 00034 // Primary maintainer for this file: Laurent Itti <itti@usc.edu> 00035 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Neuro/SimulationViewerEyeMvt2.H $ 00036 // $Id: SimulationViewerEyeMvt2.H 10825 2009-02-11 07:46:59Z itti $ 00037 // 00038 00039 #ifndef SIMULATIONVIEWEREYEMVT2_H_DEFINED 00040 #define SIMULATIONVIEWEREYEMVT2_H_DEFINED 00041 00042 #include "Component/ModelParam.H" 00043 #include "Image/ImageCache.H" 00044 #include "Image/ImageSet.H" 00045 #include "Image/LevelSpec.H" 00046 #include "Media/MediaSimEvents.H" 00047 #include "Neuro/SimulationViewer.H" 00048 #include "Neuro/NeuroSimEvents.H" 00049 #include "Simulation/SimEvents.H" 00050 #include "Util/SimTime.H" 00051 00052 class EyeTrackerSaccadeController; 00053 class SpatialMetrics; 00054 class VisualBuffer; 00055 00056 //! Measure salience at human eye positions 00057 class SimulationViewerEyeMvt2 : public SimulationViewer { 00058 public: 00059 // ###################################################################### 00060 /*! @name Constructors and destructors */ 00061 //@{ 00062 00063 //! Constructor. See ModelComponent.H. 00064 SimulationViewerEyeMvt2(OptionManager& mgr, 00065 const std::string& descrName = 00066 "EyeMvt2 Simulation Viewer", 00067 const std::string& tagName = 00068 "SimulationViewerEyeMvt2"); 00069 00070 //! Destructor 00071 virtual ~SimulationViewerEyeMvt2(); 00072 00073 //@} 00074 00075 protected: 00076 //! Callback for when the head moves 00077 SIMCALLBACK_DECLARE(SimulationViewerEyeMvt2, SimEventInputFrame); 00078 00079 //! Callback for when a new retina image is available 00080 SIMCALLBACK_DECLARE(SimulationViewerEyeMvt2, SimEventRetinaImage); 00081 00082 //! Callback for when a new attention shift occurs 00083 SIMCALLBACK_DECLARE(SimulationViewerEyeMvt2, SimEventWTAwinner); 00084 00085 //! Callback for when the eye moves 00086 SIMCALLBACK_DECLARE(SimulationViewerEyeMvt2, SimEventSaccadeStatusEye); 00087 00088 //! Callback for every time we should save our outputs 00089 SIMCALLBACK_DECLARE(SimulationViewerEyeMvt2, SimEventSaveOutput); 00090 00091 //! Get the attention/eye/head trajectory image 00092 Image< PixRGB<byte> > getTraj(SimEventQueue& q); 00093 00094 //@} 00095 00096 nub::ref<SpatialMetrics> itsMetrics; //!< metrics that depend on input size 00097 OModelParam<bool> itsSaveMegaCombo; //!< save mega combo? 00098 NModelParam< PixRGB<byte> > itsColorEye; //!< patch color for human eye mvts 00099 OModelParam<std::string> itsOutFname; //!< Name of output file 00100 OModelParam<LevelSpec> itsLevelSpec; //!< levelspec for buffer scale 00101 OModelParam<bool> itsUseIOR; //!< try to use IOR 00102 00103 //! Get started 00104 virtual void start1(); 00105 00106 //! get stopped 00107 virtual void stop1(); 00108 00109 private: 00110 Image< PixRGB<byte> > itsTraj; // trajectory 00111 Image< PixRGB<byte> > itsRawTraj; // raw unshifted trajectory 00112 FILE *itsOutFile; 00113 Point2D<int> itsLastSample; 00114 int itsLastRadius; 00115 00116 Image<byte> itsIORmask; 00117 bool itsDidAttentionShift; 00118 }; 00119 00120 #endif 00121 00122 // ###################################################################### 00123 /* So things look consistent in everyone's emacs... */ 00124 /* Local Variables: */ 00125 /* indent-tabs-mode: nil */ 00126 /* End: */