VisualFeatures.H

Go to the documentation of this file.
00001 /*!@file Channels/VisualFeatures.H definitions of known visual features */
00002 
00003 // //////////////////////////////////////////////////////////////////// //
00004 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2002 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/Channels/VisualFeatures.H $
00035 // $Id: VisualFeatures.H 14655 2011-03-30 23:42:00Z pez $
00036 //
00037 
00038 #ifndef VISUALFEATURES_H_DEFINED
00039 #define VISUALFEATURES_H_DEFINED
00040 
00041 #include "Util/Assert.H"
00042 
00043 #include <string>
00044 
00045 //! Various features that can be represented
00046 /*! We assign a specific number to each definition to speedup name printing */
00047 enum VisualFeature
00048 {
00049   UNKNOWN          = 0,            //!< Unknown feature type
00050   COMPOSITECOLOR   = 1,            //!< composite Color channel
00051   COLOR            = 2,            //!< double opponent Color complex feature
00052   SOCOLOR          = 3,            //!< single opponent Color complex feature
00053   RG               = 4,            //!< Red/green double opponency
00054   BY               = 5,            //!< Blue/yellow double-opponency
00055   SORG             = 6,            //!< Red/green single opponency
00056   SOGR             = 7,            //!< Green/Red single opponency
00057   SOBY             = 8,            //!< Blue/Yellow single opponency
00058   SOYB             = 9,            //!< Yellow/Blue single opponency
00059   R                = 10,           //!< Red channel
00060   G                = 11,           //!< green channel
00061   B                = 12,           //!< Blue channel
00062   Y                = 13,           //!< yellow channel
00063   INTENS           = 14,           //!< Intensity center-surround
00064   FLICKER          = 15,           //!< Flicker center-surround
00065   ORI              = 16,           //!< Orientation contrast
00066   TEMPLATE         = 17,           //!< Template matching
00067   COLBAND          = 18,           //!< Color band
00068   MOTION           = 19,           //!< Motion channel
00069   CONVOLVE         = 20,           //!< Convolution channel
00070   LJUNCTION        = 21,           //!< L junction channel
00071   TJUNCTION        = 22,           //!< T junction channel
00072   XJUNCTION        = 23,           //!< X junction channel
00073   ENDPOINT         = 24,           //!< End Point channel
00074   RGBCONVOLVE      = 25,           //!< Color convolution channel
00075   ENTROPY          = 26,           //!< Local entropy channel
00076   DUMMY            = 27,           //!< Dummy channel
00077   PN03CONTRAST     = 28,           //!< Local contrast (Parkhurst&Niebur 2003)
00078   DISPARITY        = 29,           //!< Disparity Channel
00079   STEREO           = 30,           //!< Stereo channel
00080   INFORMATION      = 31,           //!< Information channel
00081   RECOGNITION      = 32,           //!< Recognition channel
00082   HUE              = 33,           //!< Hue channel
00083   DIRECTFEED       = 34,           //!< DirectFeed channel
00084   MULTIDIRECTFEED  = 35,           //!< MultiDirectFeed channel
00085   VARIANCE         = 36,           //!< Variance channel
00086   TCORR            = 37,           //!< Tcorr (temporal correlation) channel
00087   SCORR            = 38,           //!< Scorr (spatial correlation) channel
00088   INTBAND          = 39,           //!< Intensity bands
00089   SIFT             = 40,           //!< SIFT keypoint channel
00090   H2SV             = 41,           //!< H2SV
00091   H1               = 42,           //!< H2SV Hue1 or CIE Lab A Red/Green
00092   H2               = 43,           //!< H2SV Hue2 or CIE Lab B Yellow/Blue
00093   SAT              = 44,           //!< H2SV Saturation
00094   VAL              = 45,           //!< H2SV Value Intensity or CIE Lab L
00095   CIELAB           = 46,           //!< CIE Lab
00096   GR               = 47,           //!< green/Red double opponency
00097   YB               = 48,           //!< yellow/Blue double-opponency
00098   FACE             = 49,           //!< face detection
00099   DEPTH            = 50,           //!< Depth
00100   DCOLOR           = 51,           //!< D component of DKL color
00101   KCOLOR           = 52,           //!< K component of DKL color
00102   LCOLOR           = 53,           //!< L component of DKL color
00103   DKLCOLOR         = 54,           //!< DKL color complex channel
00104   FOE              = 55,
00105   MST              = 56,
00106   FOEMST           = 57,
00107   FOREGROUND       = 58,           //!< Foreground probability channel
00108   MICHELSON        = 59,           //!< Michelson contrast
00109   IMGZCOLOR        = 60,           //!< Imagize 3-channel silicon retina
00110   IMGZALPHA        = 61,           //!< Imagize alpha channel
00111   IMGZBETA         = 62,           //!< Imagize beta channel
00112   IMGZLED          = 63,           //!< Imagize LED channel
00113   FLKNBACK         = 64,           //!< Flicker N-Back channel
00114   MOTIONSPATIOTEMPORAL = 65,       //!< Motion SpatioTemporal channel
00115   MOTIONOPTICALFLOW    = 66,       //!< Motion Optical Flow   channel
00116   DEPTHMOTION          = 67,       //!< Depth Motion channel
00117   MOVINGOBJECTDETECTION = 68       //!< Moving Object Detection channel
00118   // if you add any to this list, be sure to update the following below:
00119   // NBVISUALFEATURES [add 1]
00120   // featureName() [add a new name for your feature at end of list]
00121   // featureHierarchyLevel [add a new entry for your feature]
00122 };
00123 
00124 //! Number of visual features
00125 #define NBVISUALFEATURES 69
00126 
00127 //! Various types of feature representations
00128 /*! We assign a specific number to each definition to speedup name printing */
00129 enum VisualFeatureType
00130 {
00131   RAW      = 0, //!< Raw pixel data
00132   RAW_CS   = 1, //!< Center-surround data before maxnormalization
00133   NORM_CS  = 2  //!< Center-surround data after maxnormalization
00134 };
00135 //!< Number of visual feature types:
00136 #define NBVISUALFEATURETYPES 3
00137 
00138 enum VisualFeatureHierarchy
00139 {
00140   V1 = 0, //!< V1 channel in visual hierarchy
00141   V2 = 1, //!< V2 channel in visual hierarchy
00142   V4 = 2  //!< V4 channel in visual hierarchy
00143 };
00144 //!< Number of levels in the visual hierarchy
00145 #define NBVISUALFEATUREHIERARCHY 3
00146 
00147 //! Access feature name in clear
00148 inline const char *featureName(const VisualFeature f);
00149 
00150 //! Access feature type name in clear
00151 inline const char *featureTypeName(const VisualFeatureType t);
00152 
00153 //! Access feature level in the visual hierarchy
00154 inline VisualFeatureHierarchy featureHierarchyLevel(const VisualFeature f);
00155 
00156 //! Access feature visual hierarchy name in clear
00157 inline const char *featureHierarchyName(const VisualFeatureHierarchy h);
00158 
00159 // ######################################################################
00160 // ######################################################################
00161 // ######################################################################
00162 inline const char *featureName(const VisualFeature f)
00163 {
00164   static const char* n[NBVISUALFEATURES] = {
00165     "<Unknown>",
00166     "CompositeColor",
00167     "Color",
00168     "SOColor",
00169     "Red-Green",
00170     "Blue-Yellow",
00171     "SORed-Green",
00172     "SOGreen-Red",
00173     "SOBlue-Yellow",
00174     "SOYellow-Blue",
00175     "Red",
00176     "Green",
00177     "Blue",
00178     "Yellow",
00179     "Intensity",
00180     "Flicker",
00181     "Orientation",
00182     "Template",
00183     "ColorBand",
00184     "Motion",
00185     "Convolve",
00186     "L-Junction",
00187     "T-Junction",
00188     "X-Junction",
00189     "EndPoint",
00190     "RGBConvolve",
00191     "Entropy",
00192     "Dummy",
00193     "PN03contrast",
00194     "Disparity",
00195     "Stereo",
00196     "Information",
00197     "Recognition",
00198     "Hue",
00199     "DirectFeed",
00200     "MultiDirectFeed",
00201     "Variance",
00202     "Tcorr",
00203     "Scorr",
00204     "IntensityBand",
00205     "SIFT",
00206     "H2SV",
00207     "Hue1",
00208     "Hue2",
00209     "Saturation",
00210     "ValueIntensity",
00211     "CIELab",
00212     "GreenRed",
00213     "YellowBlue",
00214     "Face",
00215     "Depth",
00216     "Dcolor",
00217     "Kcolor",
00218     "Lcolor",
00219     "DKLcolor",
00220     "Foe",
00221     "MSsT",
00222     "FOEMSTtt",
00223     "Foreground",
00224     "Michelson",
00225     "ImagizeColor",
00226     "ImagizeAlpha",
00227     "ImagizeBeta",
00228     "ImagizeLED",
00229     "FlickerNBack",
00230     "MotionSpatioTemporal",
00231     "MotionOpticalFlow",
00232     "DepthMotion",
00233     "MovingObjectDetection"
00234   };
00235   ASSERT(int(f) < NBVISUALFEATURES);
00236   return n[int(f)];
00237 }
00238 
00239 // ######################################################################
00240 inline const char *featureTypeName(const VisualFeatureType t)
00241 {
00242   static const char n[NBVISUALFEATURETYPES][27] = {
00243     "Raw", "Raw Center-Surround", "Normalized Center-Surround" };
00244   return n[int(t)];
00245 }
00246 
00247 // ######################################################################
00248 inline VisualFeatureHierarchy featureHierarchyLevel(const VisualFeature f)
00249 {
00250   static const VisualFeatureHierarchy n[NBVISUALFEATURES] = {
00251     V1,    // UNKNOWN
00252     V1,    // COMPOSITECOLOR
00253     V1,    // COLOR
00254     V1,    // SOCOLOR
00255     V1,    // RG
00256     V1,    // BY
00257     V1,    // SORG
00258     V1,    // SOGR
00259     V1,    // SOBY
00260     V1,    // SOYB
00261     V1,    // R
00262     V1,    // G
00263     V1,    // B
00264     V1,    // Y
00265     V1,    // INTENS
00266     V1,    // FLICKER
00267     V1,    // ORI
00268     V1,    // TEMPLATE
00269     V1,    // COLBAND
00270     V1,    // MOTION
00271     V1,    // CONVOLVE
00272     V2,    // LJUNCTION
00273     V2,    // TJUNCTION
00274     V2,    // XJUNCTION
00275     V2,    // ENDPOINT
00276     V1,    // RGBCONVOLVE
00277     V1,    // ENTROPY
00278     V1,    // DUMMY
00279     V1,    // PN03CONTRAST
00280     V1,    // DISPARITY
00281     V1,    // STEREO
00282     V1,    // INFORMATION
00283     V2,    // RECOGNITION
00284     V1,    // Hue
00285     V1,    // DirectFeed
00286     V1,    // MultiDirectFeed
00287     V1,    // Variance
00288     V1,    // Tcorr
00289     V1,    // Scorr
00290     V1,    // Intensity bands
00291     V1,    // SIFT
00292     V1,    // H2SV
00293     V1,    // H2SV Hue1
00294     V1,    // H2SV Hue2
00295     V1,    // H2SV Saturation
00296     V1,    // H2SV Value Intensity
00297     V1,    // CIE Lab
00298     V1,    // GR
00299     V1,    // YB
00300     V1,    // Face Detector
00301     V1,    // Depth
00302     V1,    // Dcolor
00303     V1,    // Kcolor
00304     V1,    // Lcolor
00305     V1,    // DKLcolor
00306     V2,    // Foe
00307     V2,    // MSsT
00308     V2,    // FOEMSTtt
00309     V1,    // Foreground
00310     V1,    // Michelson
00311     V1,    // Imagize color
00312     V1,    // Imagize alpha
00313     V1,    // Imagize beta
00314     V1,    // Imagize LED
00315     V1,    // FlickerNBack
00316     V1,    // MotionSpatioTemporal    
00317     V1,    // MotionOpticalFlow
00318     V1,    // Depth Motion
00319     V1,    // Moving Object Detection
00320   };
00321   return n[int(f)];
00322 }
00323 
00324 // ######################################################################
00325 inline const char *featureHierarchyName(const VisualFeatureHierarchy h)
00326 {
00327   static const char n[NBVISUALFEATUREHIERARCHY][3] = { "V1", "V2", "V4" };
00328   return n[int(h)];
00329 }
00330 
00331 
00332 //! VisualFeature overload
00333 /*! Format is "name" as defined by featureName() in VisualFeatures.H */
00334 std::string convertToString(const VisualFeature val);
00335 //! VisualFeature overload
00336 /*! Format is "name" as defined by featureName() in VisualFeatures.H */
00337 void convertFromString(const std::string& str, VisualFeature& val);
00338 
00339 
00340 #endif
00341 
00342 // ######################################################################
00343 /* So things look consistent in everyone's emacs... */
00344 /* Local Variables: */
00345 /* indent-tabs-mode: nil */
00346 /* End: */
Generated on Sun May 8 08:40:22 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3