latest version v1.9 - last update 10 Apr 2010 |
00001 /* 00002 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 00003 * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany 00004 * 00005 * This file is part of the LTI-Computer Vision Library (LTI-Lib) 00006 * 00007 * The LTI-Lib is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License (LGPL) 00009 * as published by the Free Software Foundation; either version 2.1 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * The LTI-Lib is distributed in the hope that it will be 00013 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 00014 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with the LTI-Lib; see the file LICENSE. If 00019 * not, write to the Free Software Foundation, Inc., 59 Temple Place - 00020 * Suite 330, Boston, MA 02111-1307, USA. 00021 */ 00022 00023 00024 /*---------------------------------------------------------------- 00025 * project ....: LTI Digital Image/Signal Processing Library 00026 * file .......: ltiGaborPyramid.h 00027 * authors ....: Pablo Alvarado 00028 * organization: LTI, RWTH Aachen 00029 * creation ...: 30.10.00 00030 * revisions ..: $Id: ltiGaborPyramid.h,v 1.3 2006/02/08 11:09:41 ltilib Exp $ 00031 */ 00032 00033 #ifndef _LTI_GABOR_PYRAMID_H_ 00034 #define _LTI_GABOR_PYRAMID_H_ 00035 00036 #include "ltiGaussianPyramid.h" 00037 #include "ltiTypes.h" 00038 00039 namespace lti { 00040 /** 00041 * GaborPyramid class. 00042 * 00043 * This class implements a dyadic gabor pyramid, which is obtained from the 00044 * original channel, and its gaussian pyramid, where each scale is 00045 * also filtered with a gabor kernel. 00046 * 00047 * Each element of the pyramid will be obtained with the same 00048 * filter-orientation. 00049 * 00050 * See method generate() to an detailed explanation 00051 * */ 00052 template <class T> 00053 class gaborPyramid : public gaussianPyramid<T> { 00054 public: 00055 00056 /** 00057 * create a gabor pyramid with the given number of resolutions 00058 * @param resolutions the number of resolutions that the pyramid can hold 00059 * (default 0: an empty pyramid will be created) 00060 * @param orientation the angle (in radians) of the gabor kernel 00061 * (default 0) 00062 * @param gaborSize the size of the gabor kernel (default 5) 00063 * 00064 * @param bandwidth the angular bandwidth in radians. The default 00065 * value is 0.69813170 (40°), which maximizes coverage 00066 * of the frequency domain while minimizing overlap 00067 * between filters. 00068 * @param upsampleWithGaussian if false a rectangular kernel will be used 00069 * to reconstruct the scales, otherwise a gaussian kernel 00070 * will be used (default true) 00071 */ 00072 gaborPyramid(const int& resolutions = 0, 00073 const double& orientation = 0, 00074 const int& gaborSize = 5, 00075 const double& bandwidth = 0.69813170, 00076 const bool& upsampleWithGaussian = true); 00077 00078 /** 00079 * create this gaborPyramid as a copy of another gaborPyramid 00080 * @param other the gaborPyramid to be copied. 00081 */ 00082 gaborPyramid(const gaborPyramid& other); 00083 00084 /** 00085 * destructor 00086 */ 00087 virtual ~gaborPyramid(); 00088 00089 /** 00090 * return the size, variance and orientation of the used gabor kernel 00091 */ 00092 void getKernelParameters(double& orientation, 00093 int& size, 00094 double& bandwidth, 00095 bool& upsampleWithGaussian) const; 00096 00097 /** 00098 * set the kernel parameters 00099 * 00100 * @param orientation the angle (in radians) of the gabor kernel. 00101 * @param gaborSize the size of the gabor kernel (default 5) 00102 * @param bandwidth the angular bandwidth in radians. The default 00103 * value is 0.69813170 (40°), which maximizes coverage of 00104 * the frequency domain while minimizing overlap between 00105 * filters. 00106 * @param upsampleWithGaussian if false a rectangular kernel will 00107 * be used to reconstruct the scales, otherwise a gaussian 00108 * kernel will be used (default true) 00109 */ 00110 void setKernelParameters(const double& orientation, 00111 const int& gaborSize=5, 00112 const double& bandwidth=0.69813170, 00113 const bool& upsampleWithGaussian=true); 00114 00115 /** 00116 * returns the name of this class: "gaborPyramid" 00117 */ 00118 const char* getTypeName() const {return "gaborPyramid";}; 00119 00120 /** 00121 * assigment operator. 00122 * copy the contents of <code>other</code> in this %object. 00123 * @param other the source gaborPyramid to be copied. 00124 * @return a reference to this object 00125 */ 00126 gaborPyramid<T>& copy(const gaborPyramid<T>& other); 00127 00128 /** 00129 * create a clone of this gaborPyramid 00130 * @return a pointer to a copy of this gaborPyramid 00131 */ 00132 virtual mathObject* clone() const; 00133 00134 /** 00135 * generate the gabor pyramid of the given object. 00136 * 00137 * The pyramid will contain the number of resolutions specified in 00138 * the construction or in the resize() method. The resolution "0" 00139 * will correspond the the original channel, and the resolution 00140 * i+1 is always a factor 2 smaller than the resolution i. 00141 */ 00142 void generate(const T& src); 00143 00144 /** 00145 * generate the gabor pyramid of the given object. 00146 * 00147 * The pyramid will contain the number of resolutions specified 00148 * by theResolutions. 00149 * The resolution "0" will correspond the the original channel, 00150 * and the resolution i+1 is always a factor 2 smaller than 00151 * the resolution i. 00152 */ 00153 void generate(const T& src,const int& theResolutions); 00154 00155 /** 00156 * generate the gabor pyramid of the given object. Proceed, until 00157 * given limit.x or limit.y is reached. smallest resolution will 00158 * be > limit. 00159 * 00160 * The resolution "0" corresponds to the original channel, and the 00161 * resolution i+1 is always a factor 2 smaller than the resolution i. 00162 */ 00163 void generate(const T& src, const lti::point& limit); 00164 00165 protected: 00166 00167 /** 00168 * kernel orientation in radians 00169 */ 00170 double kernelOrientation; 00171 00172 /** 00173 * kernel variance 00174 */ 00175 double kernelBandwidth; 00176 }; 00177 00178 } // namespace lti 00179 00180 #include "ltiGaborPyramid_template.h" 00181 00182 #endif