Beobot.H

Go to the documentation of this file.
00001 /*!@file Beobot/Beobot.H Header file for the main Beobot class */
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/Beobot/Beobot.H $
00035 // $Id: Beobot.H 9412 2008-03-10 23:10:15Z farhan $
00036 //
00037 
00038 #ifndef BEOBOT_H_DEFINED
00039 #define BEOBOT_H_DEFINED
00040 
00041 #include "Beobot/BeobotEffectors.H"
00042 #include "Beobot/BeobotMemory.H"
00043 #include "Beobot/BeobotSensors.H"
00044 #include "Beobot/BeobotVisualCortex.H"
00045 #include "Util/Types.H"
00046 #include <netinet/in.h>
00047 
00048 //! this class is a complete Beobot
00049 /*! i.e. Visual Cortex, Memory, Sensors and Effectors */
00050 class Beobot {
00051 public:
00052   //! Constructor
00053   /*! use NULL for slaves to use the single-CPU version */
00054   Beobot(const char *slaves, const int imgw, const int imgh,
00055          const int lev_min, const int lev_max,
00056          const int delta_min, const int delta_max,
00057          const int smlev, const int nborient, const MaxNormType normtype,
00058          const int jlev, const int jdepth, const int nbneig,
00059          const in_addr_t ip, const short int port);
00060 
00061   //! set new scene from an existing image
00062   void newVisualInput(Image< PixRGB<byte> >& scene);
00063 
00064   //! get pointer to internal retina, for example to directly framegrab it
00065   Image< PixRGB<byte> >* getRetinaPtr();
00066 
00067   //! low level pyramid business
00068   /*! When using parallel processing, this method will send off the current
00069     frame and wait until all results have come back. For better performance,
00070     use lowLevelStart() and lowLevelEnd() instead. */
00071   void lowLevel(const int frame);
00072 
00073   //! start low-level by sending off current frame
00074   void lowLevelStart(const int frame);
00075 
00076   //! receive results from slave for given frame
00077   void lowLevelEnd(const int frame);
00078 
00079   //! get most salient location:
00080   void getWinner(Point2D<int>& win) const;
00081 
00082   //! compute the new "sensation" and update "memory"
00083   /*! ( given a new scene i.e. after see()
00084     and someday the state of the sensors )
00085     -- high level vision but still low level cognitive processing
00086     takeYourTime is set to 'true' for the first frame which is
00087     necessary for convergence - see implementation
00088   */
00089   void intermediateLevel(bool takeYourTime = false);
00090 
00091   //! compute the new "action" and update "memory"
00092   /*! -- higher level reasoning */
00093   void highLevel( void );
00094 
00095   //! take a decision
00096   /*! based of the recommendation issued by highLevel()
00097     and passed sensations and actions */
00098   void decision( void );
00099 
00100   //! just do it
00101   void action( void );
00102 
00103   //! returns the current clustered layout
00104   void DEBUGgetClustered(Image< PixRGB<byte> >& im);
00105 
00106   //! returns the current action
00107   void DEBUGgetCurrentAction( BeobotAction & a )
00108   { a=currentAction; };
00109 
00110   //! set the current action
00111   void DEBUGsetCurrentAction( BeobotAction & a )
00112   { currentAction = a; };
00113 
00114 private:
00115   // "brain"
00116   BeobotVisualCortex visualCortex;
00117   BeobotMemory memory;
00118 
00119   // "body"
00120   BeobotSensors sensors;
00121   nub::soft_ref<BeobotEffectors> effectors;
00122 
00123   // current action
00124   BeobotAction currentAction;
00125 
00126   // "corpus callosum"
00127   nub::soft_ref<Beowulf> beo;
00128 
00129   // parameters:
00130   int lmin, lmax, dmin, dmax, sml, nori, nortyp;
00131 };
00132 
00133 #endif
00134 
00135 // ######################################################################
00136 /* So things look consistent in everyone's emacs... */
00137 /* Local Variables: */
00138 /* indent-tabs-mode: nil */
00139 /* End: */
Generated on Sun May 8 08:04:26 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3