00001 /*!@file VFAT/targetInfo.H holds properaties of objects 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: T Nathan Mundhenk <mundhenk@usc.edu> 00035 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/VFAT/targetInfo.H $ 00036 // $Id: targetInfo.H 6003 2005-11-29 17:22:45Z rjpeters $ 00037 // 00038 00039 // ############################################################ 00040 // ############################################################ 00041 // ##### --- VFAT --- 00042 // ##### Vision Feature Analysis Tool: 00043 // ##### T. Nathan Mundhenk nathan@mundhenk.com 00044 // ##### Laurent Itti itti@pollux.usc.edu 00045 // ##### 00046 // ############################################################ 00047 // ############################################################ 00048 00049 #ifndef TARGETINFO_H_DEFINED 00050 #define TARGETINFO_H_DEFINED 00051 00052 #include "Util/log.H" 00053 00054 #include <stdlib.h> 00055 #include <string> 00056 #include <vector> 00057 #include <sys/types.h> 00058 00059 //! A general purpose container for holding guassian signatures 00060 /*! This is a general purpose container for classes from the feature 00061 classifier. Note that there are no pointers and all data is copied 00062 this allows this object to be pulled off from the other code if 00063 need be which makes it portable to other machines or memory spaces 00064 so long as the object type is known. 00065 00066 NOTE: To see how means and averages are computed along with how each 00067 sample is matched temporally, see the file covEstimate.C and the 00068 method covEstimate<T>::matchPmeanAccum(...) . This method does a 00069 nearest neighbor matching and computes temporal dynamics for each 00070 class. 00071 */ 00072 template <class FLOAT> class vfatTargetInfo 00073 { 00074 public: 00075 inline vfatTargetInfo(unsigned long _dim); 00076 inline vfatTargetInfo(); 00077 inline ~vfatTargetInfo(); 00078 inline void resize(unsigned long _dim); 00079 //! unique base ID of this object 00080 unsigned long baseID; 00081 //! Literal size of image space inspected (image width) 00082 unsigned short imageSizeX; 00083 //! Literal size of image space inspected (image height) 00084 unsigned short imageSizeY; 00085 //! image location X (for image objects) 00086 unsigned short posX; 00087 //! image location Y (for image object) 00088 unsigned short posY; 00089 //! Max and min values X and Y 00090 unsigned short maxX; 00091 //! Max and min values X and Y 00092 unsigned short minX; 00093 //! Max and min values X and Y 00094 unsigned short maxY; 00095 //! Max and min values X and Y 00096 unsigned short minY; 00097 //! what is the pixel mass of this object? 00098 unsigned int mass; 00099 //! how long has this object been alive for? 00100 unsigned long lifeSpan; 00101 //! number of diminsions in the set 00102 unsigned long dim; 00103 //! a grand mean 00104 FLOAT grandMean; 00105 00106 //! mean (centroid) values for all degrees of freedom 00107 std::vector<FLOAT> mean; 00108 //! basic standard deviation for all degrees of freedom 00109 std::vector<FLOAT> STD; 00110 //! eigenvalue result for each diminsion 00111 std::vector<FLOAT> eigenVal; 00112 //! min value for this feature 00113 std::vector<FLOAT> min; 00114 //! max value for this feature 00115 std::vector<FLOAT> max; 00116 //! this is the first order motion (partial 1st derivative) 00117 std::vector<FLOAT> speed; 00118 //! this is the second order motion (partial 2nd derivative) 00119 std::vector<FLOAT> accel; 00120 //! Average first order motion (partial 1st derivative) 00121 std::vector<FLOAT> avgspeed; 00122 //! Average second order motion (partial 2nd derivative) 00123 std::vector<FLOAT> avgaccel; 00124 //! how far has this object traveled? (partial 1st order integral) 00125 std::vector<FLOAT> distance; 00126 00127 //! this is a set of bias weights to be used if needed 00128 std::vector<FLOAT> bias; 00129 //! this is a variables normalization const 00130 std::vector<FLOAT> norm; 00131 //! this is a const to translate values used with norm 00132 std::vector<FLOAT> trans; 00133 //! A pointer to this features names 00134 std::vector<std::string> featureName; 00135 }; 00136 00137 // ###################################################################### 00138 template <class FLOAT> 00139 inline vfatTargetInfo<FLOAT>::vfatTargetInfo() 00140 {} 00141 00142 // ###################################################################### 00143 template <class FLOAT> 00144 inline vfatTargetInfo<FLOAT>::vfatTargetInfo(unsigned long _dim) 00145 { 00146 resize(_dim); 00147 } 00148 00149 // ###################################################################### 00150 template <class FLOAT> 00151 inline vfatTargetInfo<FLOAT>::~vfatTargetInfo() 00152 {} 00153 00154 // ###################################################################### 00155 template <class FLOAT> 00156 inline void vfatTargetInfo<FLOAT>::resize(unsigned long _dim) 00157 { 00158 lifeSpan = 0; 00159 dim = _dim; 00160 mean.resize(dim ,0.0F); 00161 STD.resize(dim ,0.0F); 00162 eigenVal.resize(dim,0.0F); 00163 bias.resize(dim ,1.0F); 00164 norm.resize(dim ,1.0F); 00165 trans.resize(dim ,1.0F); 00166 min.resize(dim ,0.0F); 00167 max.resize(dim ,0.0F); 00168 speed.resize(dim ,0.0F); 00169 accel.resize(dim ,0.0F); 00170 avgspeed.resize(dim,0.0F); 00171 avgaccel.resize(dim,0.0F); 00172 distance.resize(dim,0.0F); 00173 featureName.resize(dim,""); 00174 } 00175 00176 #endif