00001 /*!@file VFAT/TNOobject.H container for saccade and saliency data per sample 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/TNOobject.H $ 00036 // $Id: TNOobject.H 4663 2005-06-23 17:47:28Z 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 /************************************************************************/ 00050 00051 /*! This class is a container for each basic sample and includes 00052 the saccade data, the mask data, the saliency features, ICA features 00053 and complex features. 00054 */ 00055 00056 /************************************************************************/ 00057 class TNOobject 00058 { 00059 public: 00060 TNOobject(); 00061 ~TNOobject(); 00062 //! set the labels for this sample 00063 void setLabel(unsigned int _testImage, string _subject); 00064 //! give this sample a number of features, must be called 00065 void setFeatureNumber(unsigned int _featureNumber); 00066 //! how many data samples do we have in this object 00067 void getDataSamples(unsigned int* _dataSamples); 00068 //! who is the subject we are talking about 00069 void getSubject(string* _subject); 00070 //! which test image are we using 00071 void getTestImage(unsigned int* _testImage); 00072 //! what do we call the features we have put in 00073 void setFeatureLabel(std::vector<string> _featureLabel); 00074 //! what did we call our features 00075 void getFeatureLabel(std::vector<string>* _featureLabel); 00076 //! what is this sample number? 00077 void getFeatureNumber(unsigned int* _featureNumber); 00078 //! all data is stored with the key of saccade number 00079 //! set the current iterator position, is false if not success 00080 bool setIterator(unsigned int _iter); 00081 //! get the current iterator position 00082 void getIterator(unsigned int* _iter); 00083 //! set saccade data using iterators to fill up the data set 00084 void setSaccadeNext(unsigned int _sampleNumber, unsigned int _sampleType, 00085 float _posX, float _posY, float _jumpToX, float _jumpToY, 00086 unsigned int _jumpSize, string _comment, bool _mask, 00087 std::vector<double> _feature); 00088 //! get saccade data using iterators. Will return true at the end 00089 bool getSaccadeNext(unsigned int* _sampleNumber, unsigned int* _sampleType, 00090 float* _posX, float* _posY, float* _jumpToX, float* _jumpToY, 00091 unsigned int* _jumpSize, string* _comment, bool* _mask, 00092 std::vector<double>* _feature); 00093 //! Random access to set saccade data, bool is false if not success 00094 bool setSaccade(unsigned int _dataSample, 00095 unsigned int _sampleNumber, unsigned int _sampleType, 00096 float _posX, float _posY, float _jumpToX, float _jumpToY, 00097 unsigned int _jumpSize, string _comment, bool _mask, 00098 std::vector<double> _feature); 00099 //! Random access to get saccade data, bool is false if not success 00100 bool getSaccade(unsigned int _dataSample 00101 unsigned int _sampleNumber, unsigned int* _sampleType, 00102 float* _posX, float* _posY, float* _jumpToX, float* _jumpToY, 00103 unsigned int* _jumpSize, string* _comment, bool* _mask 00104 std::vector<double>* _feature); 00105 private: 00106 //! did we set the number of features 00107 bool featureNumberSet; 00108 //! how many data samples do we have for this image and subject 00109 unsigned int dataSamples; 00110 //! what is the test image index number 00111 unsigned int testImage; 00112 //! how many saliency features are we storing in this object 00113 unsigned int featureNumber; 00114 //! keeps track of the iterator position over all objects 00115 unsigned int itr; 00116 //! what is the subject name for this image sample 00117 string subject; 00118 //! how many saccade samples do we have 00119 std::vector<unsigned int> sampleNumber; 00120 std::vector<unsigned int>::iterator sampleNumberItr; 00121 //! what is the type for this sample (blink, saccade, etc) 00122 std::vector<unsigned int> sampleType; 00123 std::vector<unsigned int>::iterator sampleTypeItr; 00124 //! what is the eye position X 00125 std::vector<float> posX; 00126 std::vector<float>::iterator posXItr; 00127 //! what is the eye position Y 00128 std::vector<float> posY; 00129 std::vector<float>::iterator posYItr; 00130 //! where are they jumping to X? 00131 std::vector<float> jumpToX; 00132 std::vector<float>::iterator jumpToXItr; 00133 //! where are they jumping to Y? 00134 std::vector<float> jumpToY; 00135 std::vector<float>::iterator jumpToYItr; 00136 //! many samples in durration is this jump (see eyeS data) 00137 std::vector<unsigned int> jumpSize; 00138 std::vector<unsigned int>::iterator jumpSizeItr; 00139 //! any additional comment about this data 00140 std::vector<string> comment; 00141 std::vector<string>::iterator commentItr; 00142 //! is this a mask location in the image? 00143 std::vector<bool> mask; 00144 std::vector<bool>::iterator maskItr; 00145 //! what is the saliency etc. feature set? 00146 std::vector<std::vector<double> > feature; 00147 std::vector<std::vector<double> >::iterator featureItr; 00148 //! prototype object for feature 00149 std::vector<double> protoFeature; 00150 std::vector<double>::iterator protoFeatureItr; 00151 //! what are the labels for this feature? 00152 std::vector<string> featureLabel; 00153 } 00154 00155