Image Component Library (ICL)
MedianOp.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLFilter/src/ICLFilter/MedianOp.h **
10 ** Module : ICLFilter **
11 ** Authors: Christof Elbrechter, Robert Haschke, Andre Justus, **
12 ** Sergius Gaulik **
13 ** **
14 ** **
15 ** GNU LESSER GENERAL PUBLIC LICENSE **
16 ** This file may be used under the terms of the GNU Lesser General **
17 ** Public License version 3.0 as published by the **
18 ** **
19 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
20 ** included in the packaging of this file. Please review the **
21 ** following information to ensure the license requirements will **
22 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
23 ** **
24 ** The development of this software was supported by the **
25 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
26 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
27 ** Forschungsgemeinschaft (DFG) in the context of the German **
28 ** Excellence Initiative. **
29 ** **
30 ********************************************************************/
31 
32 #pragma once
33 
34 #include <ICLUtils/CompatMacros.h>
36 
37 namespace icl {
38  namespace filter{
39 
41 
237  public:
238 
240 
243  MedianOp (const utils::Size &maskSize):NeighborhoodOp(adaptSize(maskSize)){}
244 
246 
250  void apply(const core::ImgBase *poSrc, core::ImgBase **ppoDst);
251 
253  using NeighborhoodOp::apply;
254 
256 
262  virtual utils::Size adaptSize(const utils::Size &size){
263  return utils::Size(1+ 2*(size.width/2),1+ 2*(size.height/2));
264  }
265 
266 
267  };
268 
269  } // namespace filter
270 }
undocument this line if you encounter any issues!
Definition: Any.h:37
Class that provides median filter abilities .
Definition: MedianOp.h:236
Size class of the ICL.
Definition: Size.h:61
virtual utils::Size adaptSize(const utils::Size &size)
ensures that mask width and height are odd
Definition: MedianOp.h:262
ICLQt_API core::Img< T > filter(const core::Img< T > &image, const std::string &filter)
applies a filter operation on the source image (affinity for float)
unary operators that work on each pixels neighborhood \
Definition: NeighborhoodOp.h:59
MedianOp(const utils::Size &maskSize)
Constructor that creates a median filter object, with specified mask size.
Definition: MedianOp.h:243
#define ICLFilter_API
Definition: CompatMacros.h:175
virtual void apply(const core::ImgBase *operand1, core::ImgBase **dst)=0
pure virtual apply function, that must be implemented in all derived classes
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131