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/MedianOp.h ** 00010 ** Module : ICLFilter ** 00011 ** Authors: Christof Elbrechter, Robert Haschke, Andre Justus, ** 00012 ** Sergius Gaulik ** 00013 ** ** 00014 ** ** 00015 ** GNU LESSER GENERAL PUBLIC LICENSE ** 00016 ** This file may be used under the terms of the GNU Lesser General ** 00017 ** Public License version 3.0 as published by the ** 00018 ** ** 00019 ** Free Software Foundation and appearing in the file LICENSE.LGPL ** 00020 ** included in the packaging of this file. Please review the ** 00021 ** following information to ensure the license requirements will ** 00022 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt ** 00023 ** ** 00024 ** The development of this software was supported by the ** 00025 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. ** 00026 ** The Excellence Cluster EXC 277 is a grant of the Deutsche ** 00027 ** Forschungsgemeinschaft (DFG) in the context of the German ** 00028 ** Excellence Initiative. ** 00029 ** ** 00030 ********************************************************************/ 00031 00032 #pragma once 00033 00034 #include <ICLUtils/CompatMacros.h> 00035 #include <ICLFilter/NeighborhoodOp.h> 00036 00037 namespace icl { 00038 namespace filter{ 00039 00041 00236 class ICLFilter_API MedianOp : public NeighborhoodOp { 00237 public: 00238 00240 00243 MedianOp (const utils::Size &maskSize):NeighborhoodOp(adaptSize(maskSize)){} 00244 00246 00250 void apply(const core::ImgBase *poSrc, core::ImgBase **ppoDst); 00251 00253 using NeighborhoodOp::apply; 00254 00256 00262 virtual utils::Size adaptSize(const utils::Size &size){ 00263 return utils::Size(1+ 2*(size.width/2),1+ 2*(size.height/2)); 00264 } 00265 00266 00267 }; 00268 00269 } // namespace filter 00270 }