Image Component Library (ICL)
|
00001 /******************************************************************** 00002 ** Image Component Library (ICL) ** 00003 ** ** 00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld ** 00005 ** Neuroinformatics Group ** 00006 ** Website: www.iclcv.org and ** 00007 ** http://opensource.cit-ec.de/projects/icl ** 00008 ** ** 00009 ** File : ICLFilter/src/ICLFilter/GaborOp.h ** 00010 ** Module : ICLFilter ** 00011 ** Authors: Christof Elbrechter ** 00012 ** ** 00013 ** ** 00014 ** GNU LESSER GENERAL PUBLIC LICENSE ** 00015 ** This file may be used under the terms of the GNU Lesser General ** 00016 ** Public License version 3.0 as published by the ** 00017 ** ** 00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL ** 00019 ** included in the packaging of this file. Please review the ** 00020 ** following information to ensure the license requirements will ** 00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt ** 00022 ** ** 00023 ** The development of this software was supported by the ** 00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. ** 00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche ** 00026 ** Forschungsgemeinschaft (DFG) in the context of the German ** 00027 ** Excellence Initiative. ** 00028 ** ** 00029 ********************************************************************/ 00030 00031 #pragma once 00032 00033 #include <ICLUtils/CompatMacros.h> 00034 #include <ICLUtils/Uncopyable.h> 00035 #include <ICLUtils/Point.h> 00036 #include <ICLCore/Img.h> 00037 #include <ICLFilter/UnaryOp.h> 00038 #include <vector> 00039 00040 namespace icl{ 00041 namespace filter{ 00043 class ConvolutionOp; 00047 00048 00118 class ICLFilter_API GaborOp : public UnaryOp, public utils::Uncopyable{ 00119 public: 00121 GaborOp(); 00122 00124 00141 GaborOp(const utils::Size &kernelSize, 00142 std::vector<icl32f> lambdas, 00143 std::vector<icl32f> thetas, 00144 std::vector<icl32f> psis, 00145 std::vector<icl32f> sigmas, 00146 std::vector<icl32f> gammas ); 00147 00148 ~GaborOp(); 00149 00151 00153 void setKernelSize(const utils::Size &size); 00154 00156 void addLambda(float lambda); 00157 00159 void addTheta(float theta); 00160 00162 void addPsi(float psi); 00163 00165 void addSigma(float sigma); 00166 00168 void addGamma(float gamma); 00169 00171 void updateKernels(); 00172 00174 00177 virtual void apply(const core::ImgBase *poSrc, core::ImgBase **ppoDst); 00178 00180 using UnaryOp::apply; 00181 00183 00185 std::vector<icl32f> apply(const core::ImgBase *poSrc, const utils::Point &p); 00186 00188 00195 static core::Img32f *createKernel(const utils::Size &size, float lambda, 00196 float theta, float psi, float sigma, float gamma); 00197 00199 const std::vector<core::Img32f> &getKernels() const { return m_vecKernels; } 00200 00201 00202 private: 00203 std::vector<icl32f> m_vecLambdas; 00204 std::vector<icl32f> m_vecThetas; 00205 std::vector<icl32f> m_vecPsis; 00206 std::vector<icl32f> m_vecSigmas; 00207 std::vector<icl32f> m_vecGammas; 00208 00209 std::vector<core::Img32f> m_vecKernels; 00210 std::vector<core::ImgBase*> m_vecResults; 00211 utils::Size m_oKernelSize; 00212 }; 00213 } // namespace filter 00214 } 00215 00216 00217