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.GPL ** 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 <ICLFilter/UnaryOp.h> 00034 #include <ICLCore/Img.h> 00035 #include <ICLUtils/Point.h> 00036 #include <vector> 00037 #include <ICLUtils/Uncopyable.h> 00038 00039 namespace icl{ 00040 namespace filter{ 00042 class ConvolutionOp; 00046 00047 00117 class GaborOp : public UnaryOp, public utils::Uncopyable{ 00118 public: 00120 GaborOp(); 00121 00123 00140 GaborOp(const utils::Size &kernelSize, 00141 std::vector<icl32f> lambdas, 00142 std::vector<icl32f> thetas, 00143 std::vector<icl32f> psis, 00144 std::vector<icl32f> sigmas, 00145 std::vector<icl32f> gammas ); 00146 00147 ~GaborOp(); 00148 00150 00152 void setKernelSize(const utils::Size &size); 00153 00155 void addLambda(float lambda); 00156 00158 void addTheta(float theta); 00159 00161 void addPsi(float psi); 00162 00164 void addSigma(float sigma); 00165 00167 void addGamma(float gamma); 00168 00170 void updateKernels(); 00171 00173 00176 virtual void apply(const core::ImgBase *poSrc, core::ImgBase **ppoDst); 00177 00179 using UnaryOp::apply; 00180 00182 00184 std::vector<icl32f> apply(const core::ImgBase *poSrc, const utils::Point &p); 00185 00187 00194 static core::Img32f *createKernel(const utils::Size &size, float lambda, 00195 float theta, float psi, float sigma, float gamma); 00196 00198 const std::vector<core::Img32f> &getKernels() const { return m_vecKernels; } 00199 00200 00201 private: 00202 std::vector<icl32f> m_vecLambdas; 00203 std::vector<icl32f> m_vecThetas; 00204 std::vector<icl32f> m_vecPsis; 00205 std::vector<icl32f> m_vecSigmas; 00206 std::vector<icl32f> m_vecGammas; 00207 00208 std::vector<core::Img32f> m_vecKernels; 00209 std::vector<core::ImgBase*> m_vecResults; 00210 utils::Size m_oKernelSize; 00211 }; 00212 } // namespace filter 00213 } 00214 00215 00216