Image Component Library (ICL)
RegionDetector.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 : ICLCV/src/ICLCV/RegionDetector.h **
10 ** Module : ICLCV **
11 ** Authors: Christof Elbrechter, Erik Weitnauer **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLUtils/Uncopyable.h>
35 #include <ICLUtils/Configurable.h>
36 #include <ICLCore/ImgBase.h>
37 #include <ICLCV/ImageRegion.h>
38 
39 #include <vector>
40 
41 namespace icl{
42  namespace cv{
43 
45 
180 
181  struct Data;
182  Data *m_data;
183 
184  public:
185 
187 
188  RegionDetector(bool createRegionGraph, const std::string &configurableID=Configurable::create_default_ID("region-detector-"));
189 
191  RegionDetector(int minSize=1, int maxSize=400000000, int minVal=0, int maxVal=255, bool createRegionGraph=false,
192  const std::string &configurableID=Configurable::create_default_ID("region-detector-"));
193 
195  virtual ~RegionDetector();
196 
198  void setConstraints(int minSize, int maxSize, int minVal, int maxVal);
199 
201  void setCreateGraph(bool on);
202 
204 
207  void setCSSParams(float angle_thresh=162.,
208  float rc_coeff=1.5,
209  float sigma=3.,
210  float curvature_cutoff=100.,
211  float straight_line_thresh=0.1);
212 
214 
215  const std::vector<ImageRegion> &detect(const core::ImgBase *image);
216 
218 
220  const ImageRegion click(const utils::Point &pos);
221  const std::vector<ImageRegion> & getLastDetectedRegions();
222  private:
223 
225  void useImage(const core::ImgBase *image) ;
226 
228 
229  void analyseRegions();
230 
232 
233  void joinRegions();
234 
236 
237  void linkRegions();
238 
240 
241  void setUpBorders();
242 
244 
245  void filterRegions();
246 
247  };
248 
249  } // namespace cv
250 }
251 
252 
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
#define ICLCV_API
Definition: CompatMacros.h:177
Data * m_data
internal data structure
Definition: RegionDetector.h:181
ImageRegion Structure providing region feature information.
Definition: ImageRegion.h:99
static std::string create_default_ID(const std::string &prefix)
this function can be used in subclasses to create a default ID
Complex utility class for detection of connected image components.
Definition: RegionDetector.h:179
Point class of the ICL used e.g. for the Images ROI offset.
Definition: Point.h:58
Interface for classes that can be configured from configuration-files and GUI-Components.
Definition: Configurable.h:194
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131