00001 /*!@file ObjRec/ObjRecSalBayes.H Obj Reconition using SalBayes 00002 */ 00003 00004 // //////////////////////////////////////////////////////////////////// // 00005 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the // 00006 // 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: Lior Elazary <elazary@usc.edu> 00035 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/ObjRec/ObjRecSalBayes.H $ 00036 // $Id: ObjRecSalBayes.H 9412 2008-03-10 23:10:15Z farhan $ 00037 // 00038 00039 #ifndef ObjRecSalBayes_H_DEFINED 00040 #define ObjRecSalBayes_H_DEFINED 00041 00042 #include "Component/ModelComponent.H" 00043 #include "Component/ModelParam.H" 00044 #include "Image/Image.H" 00045 #include "Image/ImageSet.H" 00046 #include "Image/Pixels.H" 00047 #include "Channels/DescriptorVec.H" 00048 #include "Learn/Bayes.H" 00049 #include "Neuro/StdBrain.H" 00050 #include "Component/ModelManager.H" 00051 #include "Image/Image.H" 00052 #include "Image/ImageSet.H" 00053 #include "Image/ShapeOps.H" 00054 #include "Image/CutPaste.H" 00055 #include "Image/DrawOps.H" 00056 #include "Image/FilterOps.H" 00057 #include "Image/ColorOps.H" 00058 #include "Image/Transforms.H" 00059 #include "Image/MathOps.H" 00060 #include "Neuro/StdBrain.H" 00061 #include "Neuro/VisualCortex.H" 00062 #include "Neuro/NeuroOpts.H" 00063 #include "Media/FrameSeries.H" 00064 #include "Transport/FrameInfo.H" 00065 #include "Raster/GenericFrame.H" 00066 #include "Media/TestImages.H" 00067 #include "Media/SceneGenerator.H" 00068 #include "Media/MediaSimEvents.H" 00069 #include "Channels/DescriptorVec.H" 00070 #include "Channels/ComplexChannel.H" 00071 #include "Channels/SubmapAlgorithmBiased.H" 00072 #include "Simulation/SimEventQueue.H" 00073 #include "Simulation/SimulationOpts.H" 00074 #include "Simulation/SimEventQueueConfigurator.H" 00075 #include "Neuro/NeuroSimEvents.H" 00076 #include "GUI/DebugWin.H" 00077 #include "ObjRec/MaskBiaser.H" 00078 00079 #include <vector> 00080 #include <limits> 00081 00082 class ObjRecSalBayes : public ModelComponent 00083 { 00084 public: 00085 00086 //Constructor 00087 ObjRecSalBayes(ModelManager& mgr, 00088 const std::string& descrName = "ObjRecSalBayes", 00089 const std::string& tagName = "ObjRecSalBayes"); 00090 ~ObjRecSalBayes(); 00091 00092 //########################################################### 00093 00094 void start2(); 00095 00096 void train(const Image<PixRGB<byte> > &img, const std::string label); 00097 void finalizeTraining(); 00098 std::string predict(const Image<PixRGB<byte> > &img); 00099 00100 Point2D<int> evolveBrain(const Image<PixRGB<byte> > &img); 00101 00102 void extractFeatures(const Image<PixRGB<byte> > &img); 00103 00104 00105 private: 00106 bool itsDebug; 00107 int itsFoveaRadius; 00108 SimEventQueue itsQ; 00109 ModelManager *itsMgr; 00110 00111 nub::soft_ref<StdBrain> itsStdBrain; 00112 DescriptorVec *itsDescVec; 00113 Bayes *itsBayesNet; 00114 }; 00115 00116 #endif 00117 00118 // ###################################################################### 00119 /* So things look consistent in everyone's emacs... */ 00120 /* Local Variables: */ 00121 /* indent-tabs-mode: nil */ 00122 /* End: */