00001 /*!@file Neuro/EnvSaliencyMap.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/EnvSaliencyMap.H $ 00035 // $Id: EnvSaliencyMap.H 11346 2009-06-24 22:31:27Z lior $ 00036 // 00037 00038 #ifndef NEURO_ENVSALIENCYMAP_H_DEFINED 00039 #define NEURO_ENVSALIENCYMAP_H_DEFINED 00040 00041 #include "Component/ModelComponent.H" 00042 #include "Component/ModelParam.H" 00043 #include "Image/Image.H" 00044 #include "Image/LevelSpec.H" 00045 #include "Image/Point2D.H" 00046 #include "Util/Types.H" 00047 00048 extern const ModelOptionDef OPT_EsmIorHalfLife; 00049 extern const ModelOptionDef OPT_EsmIorStrength; 00050 extern const ModelOptionDef OPT_EsmIorRadius; 00051 extern const ModelOptionDef OPT_EsmInertiaRadius; 00052 extern const ModelOptionDef OPT_EsmInertiaStrength; 00053 extern const ModelOptionDef OPT_EsmInertiaHalfLife; 00054 extern const ModelOptionDef OPT_EsmInertiaShiftThresh; 00055 00056 class EnvSaliencyMap : public ModelComponent 00057 { 00058 public: 00059 EnvSaliencyMap(OptionManager& mgr); 00060 00061 virtual ~EnvSaliencyMap(); 00062 00063 virtual void paramChanged(ModelParamBase* const param, 00064 const bool valueChanged, 00065 ParamClient::ChangeStatus* status); 00066 00067 struct LocInfo 00068 { 00069 Point2D<int> lowres_maxpos; 00070 Point2D<int> fullres_maxpos; 00071 byte maxval; 00072 }; 00073 00074 struct State 00075 { 00076 Image<byte> salmap; 00077 Point2D<int> lowres_maxpos; 00078 Point2D<int> fullres_maxpos; 00079 std::vector<LocInfo> nMostSalientLoc; 00080 byte maxval; 00081 }; 00082 00083 State getSalmap(const Image<byte>& vcxmap, 00084 const Point2D<int>& forceWinnerFullres = Point2D<int>(-1,-1)); 00085 00086 const Image<byte>& getInhibmap() const { return itsInhibMap; } 00087 00088 const Image<float>& getInertiaMap() const { return itsInertiaMap; } 00089 00090 bool getUseFixed() const { return itsUseFixed.getVal(); } 00091 double getInertiaHalfLife() const { return itsInertiaHalfLife.getVal(); } 00092 double getInertiaStrength() const { return itsInertiaStrength.getVal(); } 00093 double getInertiaRadius() const { return itsInertiaRadius.getVal(); } 00094 double getInertiaShiftThresh() const { return itsInertiaShiftThresh.getVal(); } 00095 double getIorHalfLife() const { return itsIorHalfLife.getVal(); } 00096 double getIorStrength() const { return itsIorStrength.getVal(); } 00097 double getIorRadius() const { return itsIorRadius.getVal(); } 00098 double getVcxFlicker() const { return itsVcxFlicker; } 00099 00100 double getDynamicFactor() const { return itsDynamicFactor; } 00101 00102 void setUseFixed(bool v) { itsUseFixed.setVal(v); } 00103 void setInertiaHalfLife(double v) { itsInertiaHalfLife.setVal(v); } 00104 void setInertiaStrength(double v) { itsInertiaStrength.setVal(v); } 00105 void setInertiaRadius(double v) { itsInertiaRadius.setVal(v); } 00106 void setInertiaShiftThresh(double v) { itsInertiaShiftThresh.setVal(v); } 00107 void setIorHalfLife(double v) { itsIorHalfLife.setVal(v); } 00108 void setIorStrength(double v) { itsIorStrength.setVal(v); } 00109 void setIorRadius(double v) { itsIorRadius.setVal(v); } 00110 void setBiasImg(const Image<byte> &img) { itsBiasImg = img; } 00111 void resetBiasImg() { itsBiasImg = Image<byte>(); } 00112 00113 00114 private: 00115 Point2D<int> itsInertiaLoc; 00116 double itsCurrentInertiaFactor; 00117 Image<float> itsInertiaMap; 00118 Image<byte> itsInhibMap; 00119 OModelParam<bool> itsUseFixed; 00120 OModelParam<int> itsFixedX; 00121 OModelParam<int> itsFixedY; 00122 OModelParam<int> itsGetNMostSalientLoc; 00123 OModelParam<int> itsInternalIORRadius; 00124 OModelParam<double> itsDynamicFeedback; 00125 OModelParam<double> itsInertiaHalfLife; 00126 OModelParam<double> itsInertiaStrength; 00127 OModelParam<double> itsInertiaRadius; 00128 OModelParam<double> itsInertiaShiftThresh; 00129 OModelParam<double> itsIorHalfLife; 00130 OModelParam<double> itsIorStrength; 00131 OModelParam<double> itsIorRadius; 00132 OModelParam<LevelSpec> itsLevelSpec; 00133 OModelParam<std::string> itsTextLogFile; 00134 00135 double itsDynamicFactor; 00136 00137 Image<float> itsVcxMovingAvg; 00138 Image<byte> itsBiasImg; 00139 double itsVcxFlicker; 00140 const double itsVcxMeanDiffCenter; 00141 const double itsVcxFlickerMin; 00142 }; 00143 00144 // ###################################################################### 00145 /* So things look consistent in everyone's emacs... */ 00146 /* Local Variables: */ 00147 /* mode: c++ */ 00148 /* indent-tabs-mode: nil */ 00149 /* End: */ 00150 00151 #endif // NEURO_ENVSALIENCYMAP_H_DEFINED