LowPassLpt.H

Go to the documentation of this file.
00001 /*!@file Image/LowPassLpt.H low-pass filtering and smoothing functions */
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: David J. Berg <dberg@usc.edu>
00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Image/LowPassLpt.H $
00035 //
00036 
00037 #ifndef IMAGE_LOWPASSLPT_H_DEFINED
00038 #define IMAGE_LOWPASSLPT_H_DEFINED
00039 
00040 #include "Util/Promotions.H"
00041 
00042 class Dims;
00043 template <class T> class Image;
00044 
00045 //There are three possible border conditions for space variant images
00046 //based on radial transforms. Most such transforms will store the
00047 //image in 'rings' (distance from center of image) by 'wedges'
00048 //(angle). It is often convenient to rearange this output image so
00049 //that the fovia is at the center, with angles -PI/2->PI/2 (right
00050 //hemifield) on the right and the other half of space accordingly on
00051 //the left. This arrangement would allow for three reasonable ways
00052 //convolution could be performed.
00053 //
00054 //1) SEPARATE_HEMI
00055      //No hemifield interactions. Clean (normalized energy) border
00056      //conditions apply at each hemifild in both directions.
00057 //2) CROSS_HEMI
00058      //Convolutions will cross hemifields in both the R (ring) and W
00059      //(wedge) dirctions.
00060 //3) CROSS_ANGLE
00061      //Convolutions will only cross hemifields in the W (wedge)
00062      //direction. Clean (normalized energy) border condition will be
00063      //applied in the R (ring) dircection.
00064 enum BorderPolicy {NONE = 0, SEPARATE_HEMI = 1, CROSS_HEMI = 2,
00065                    CROSS_ANGLE = 3};
00066 
00067 
00068 //! Low-pass filter using a 3 or 5 tap binomial
00069 template <class T_or_RGB>
00070 Image<typename promote_trait<T_or_RGB, float>::TP>
00071 lowPassLpt(const Image<T_or_RGB>& src, const uint taps = 5,
00072             const BorderPolicy policy = CROSS_HEMI);
00073 
00074 
00075 //! Low-pass filter, coeff * [0.25 0.5 0.25], applied separably in R
00076 //('rings') and W ('wedges'). The BorderPolicy argument will determine
00077 //how to handle the borders and hemifields of an lpt image.
00078 template <class T_or_RGB>
00079 Image<typename promote_trait<T_or_RGB, float>::TP>
00080 lowPassLpt3(const Image<T_or_RGB>& src,
00081             const BorderPolicy policy = CROSS_HEMI);
00082 
00083 //! Low-pass filter an Lpt image, coeff * [0.25 0.5 0.25], applied in
00084 //! R. Here we don't allow the filter to cross hemidfilds along the R
00085 //! direction. Use LowPass3x in LowPass.H if you want hemifields to
00086 //! interact.
00087 template <class T_or_RGB>
00088 Image<typename promote_trait<T_or_RGB, float>::TP>
00089 lowPassLpt3r(const Image<T_or_RGB>& src);
00090 
00091 //! Low-pass filter an Lpt image, coeff * [0.25 0.5 0.25], applied in
00092 //! W. Here we allow the filter to cross to the other hemifield when
00093 //! filtering in the W direction so space connects at the vertical
00094 //! meridian. Use LowPass3y in LowPass.H if you dont want to cross the
00095 //! meridian.
00096 template <class T_or_RGB>
00097 Image<typename promote_trait<T_or_RGB, float>::TP>
00098 lowPassLpt3w(const Image<T_or_RGB>& src);
00099 
00100 
00101 //! Low-pass filter an lpt image, coeff * [1 4 6 4 1]/16, applied
00102 //separably in R and W. The policy will determine how to handle the
00103 //borders and hemifields of an lpt image.
00104 template <class T_or_RGB>
00105 Image<typename promote_trait<T_or_RGB, float>::TP>
00106 lowPassLpt5(const Image<T_or_RGB>& src,
00107             const BorderPolicy policy = CROSS_HEMI);
00108 
00109 //! Low-pass filter an Lpt image, coef * [1 4 6 4 1]/16  applied in
00110 //! R. Here we don't allow the filter to cross hemidfilds along the R
00111 //! direction. Use LowPass5x in LowPass.H if you want hemifield to
00112 //! interact.
00113 template <class T_or_RGB>
00114 Image<typename promote_trait<T_or_RGB, float>::TP>
00115 lowPassLpt5r(const Image<T_or_RGB>& src);
00116 
00117 //! Low-pass filter an Lpt image, coef * [1 4 6 4 1]/16 applied in
00118 //! W. Here we allow the filter to cross to the other hemifield when
00119 //! filtering in the W direction so space connects at the vertical
00120 //! meridian. Use LowPass5y in LowPass.H if you dont want to cross the
00121 //! meridian.
00122 template <class T_or_RGB>
00123 Image<typename promote_trait<T_or_RGB, float>::TP>
00124 lowPassLpt5w(const Image<T_or_RGB>& src);
00125 
00126 
00127 // ######################################################################
00128 /* So things look consistent in everyone's emacs... */
00129 /* Local Variables: */
00130 /* mode: c++ */
00131 /* indent-tabs-mode: nil */
00132 /* End: */
00133 
00134 #endif // IMAGE_LOWPASSLPT_H_DEFINED
Generated on Sun May 8 08:40:55 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3