EnvInferoTemporal.H

Go to the documentation of this file.
00001 /*!@file Neuro/EnvInferoTemporal.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: Rob Peters <rjpeters at usc dot edu>
00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Neuro/EnvInferoTemporal.H $
00035 // $Id: EnvInferoTemporal.H 9743 2008-05-11 00:42:18Z lior $
00036 //
00037 
00038 #ifndef NEURO_ENVINFEROTEMPORAL_H_DEFINED
00039 #define NEURO_ENVINFEROTEMPORAL_H_DEFINED
00040 
00041 #include "Component/ModelComponent.H"
00042 #include "Component/ModelParam.H"
00043 #include "Image/Image.H"
00044 #include "Image/Pixels.H"
00045 #include "NeovisionII/Nv2LabelReader.H"
00046 #include "rutz/shared_ptr.h"
00047 #include "rutz/time.h"
00048 
00049 #include <stdint.h>
00050 #include <string>
00051 #include <vector>
00052 
00053 class EnvInferoTemporal : public ModelComponent
00054 {
00055 public:
00056   EnvInferoTemporal(OptionManager& mgr);
00057 
00058   virtual ~EnvInferoTemporal();
00059 
00060   virtual void paramChanged(ModelParamBase* const param,
00061                             const bool valueChanged,
00062                             ParamClient::ChangeStatus* status);
00063 
00064   void initReaders(const std::string& addrlist);
00065 
00066   void sendPatch(const uint32_t id,
00067                  const Image<PixRGB<byte> >& fullimg,
00068                  const Rectangle& foa,
00069                  const rutz::time& qtime,
00070                  bool is_training_image,
00071                  const std::string& training_label,
00072                  const std::string& remote_command,
00073                  Point2D<int> fixLoc = Point2D<int>(0,0));
00074 
00075   std::vector<Nv2LabelReader::LabeledImage>
00076   getLabeledImages(const size_t text_length);
00077 
00078   bool belowConfidenceThresh() const;
00079 
00080   double getMaxConfidence() const;
00081 
00082   double getConfidenceThresh() const
00083   { return itsConfidenceThresh.getVal(); }
00084 
00085 private:
00086   EnvInferoTemporal(const EnvInferoTemporal&);
00087   EnvInferoTemporal& operator=(const EnvInferoTemporal&);
00088 
00089   void addNewPatchReader(const std::string& addr);
00090 
00091   OModelParam<double> itsConfidenceThresh;
00092   NModelParam<bool> itsIgnoreNomatch;
00093   OModelParam<std::string> itsAddPatchReader;
00094   NModelParam<std::string> itsOnlineAddPatchReader;
00095 
00096   std::vector<rutz::shared_ptr<Nv2LabelReader> > itsReaders;
00097   mutable pthread_mutex_t itsReadersLock;
00098 };
00099 
00100 // ######################################################################
00101 /* So things look consistent in everyone's emacs... */
00102 /* Local Variables: */
00103 /* mode: c++ */
00104 /* indent-tabs-mode: nil */
00105 /* End: */
00106 
00107 #endif // NEURO_ENVINFEROTEMPORAL_H_DEFINED
Generated on Sun May 8 08:41:02 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3