00001 /*!@file Channels/H2SVChannel.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: T. Nathan Mundhenk <mundhenk@usc.edu> 00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Channels/H2SVChannel.H $ 00035 // $Id: H2SVChannel.H 11094 2009-04-07 05:59:42Z mundhenk $ 00036 // 00037 00038 #ifndef H2SVCHANNEL_H_DEFINED 00039 #define H2SVCHANNEL_H_DEFINED 00040 00041 #include "Channels/ComplexChannel.H" 00042 #include "Channels/ColorComputeTypes.H" 00043 00044 class Hue1Channel; 00045 class Hue2Channel; 00046 class SaturationChannel; 00047 class ValueIntensityChannel; 00048 00049 // ###################################################################### 00050 //! A double opponent color channel class that combines r/g, b/y subchannels. 00051 /*! This is an example of an heterogeneous complex channel where the 00052 various subchannels have distinct visual features. Thus, the JetSpec 00053 representation for such complex channel will be a series of 00054 independent single-channel representations, one for each 00055 subchannel. 00056 00057 Additionally, Saturation and intensity are extracted. Extracting color in 00058 this way creates an othogonal set of values that are invertable. Thus, 00059 we can recover R,G and B from H2SV which contains Intensity, Saturation and 00060 color combined. 00061 */ 00062 class H2SVChannel : public ComplexChannel 00063 { 00064 public: 00065 //! Construct with standard params. 00066 H2SVChannel(OptionManager& mgr); 00067 00068 //! Destructor 00069 virtual ~H2SVChannel(); 00070 00071 //! Get access the RedGreen Hue1 subchannel. 00072 virtual Hue1Channel& H1() const; 00073 00074 //! Get access to the BlueYellow Hue2 subchannel. 00075 virtual Hue2Channel& H2() const; 00076 00077 //! Get access the RedGreen Hue1 subchannel. 00078 virtual SaturationChannel& S() const; 00079 00080 //! Get access to the BlueYellow Hue2 subchannel. 00081 virtual ValueIntensityChannel& V() const; 00082 00083 protected: 00084 //! ColorChannel requires only color input. 00085 virtual void doInput(const InputFrame& inframe); 00086 00087 /// Install a different H1 red/green channel 00088 void setH1(nub::ref<Hue1Channel> h1); 00089 00090 /// Install a different H2 blue/yellow channel 00091 void setH2(nub::ref<Hue2Channel> h2); 00092 00093 /// Install a different saturation channel 00094 void setS(nub::ref<SaturationChannel> s); 00095 00096 /// Install a different value intensity channel 00097 void setV(nub::ref<ValueIntensityChannel> v); 00098 00099 OModelParam<bool> itsUseH2SV1; 00100 00101 private: 00102 Image<float> itsH1img, itsH2img, itsSimg, itsVimg; 00103 nub::ref<Hue1Channel> itsH1; 00104 nub::ref<Hue2Channel> itsH2; 00105 nub::ref<SaturationChannel> itsS; 00106 nub::ref<ValueIntensityChannel> itsV; 00107 //! Use a sigmoid transfer function to calm color by saturation 00108 bool itsUseSigmoid; 00109 float itsSigAlpha; 00110 float itsSigBeta; 00111 }; 00112 00113 // ###################################################################### 00114 /* So things look consistent in everyone's emacs... */ 00115 /* Local Variables: */ 00116 /* indent-tabs-mode: nil */ 00117 /* End: */ 00118 00119 #endif // H2SVCHANNEL_H_DEFINED