Image Component Library (ICL)
SimpleBlobSearcher.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/SimpleBlobSearcher.h **
10 ** Module : ICLCV **
11 ** Authors: Christof Elbrechter **
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/Range.h>
35 #include <ICLUtils/Uncopyable.h>
36 #include <ICLCore/Color.h>
37 #include <ICLCV/ImageRegion.h>
38 
39 namespace icl{
40  namespace cv{
41 
43 
74  public:
75 
77  struct ICLCV_API Blob{
78  Blob():region(0),refColorIndex(-1){}
79  Blob(const ImageRegion *region, const core::Color &refColor, int refColorIndex);
80 
83 
86 
89  };
90 
93 
96 
98  void add(const core::Color &color,
99  float thresh,
100  const utils::Range32s &sizeRange);
101 
103  void adapt(int index, const core::Color &color,
104  float thresh, const utils::Range32s &sizeRange);
105 
107  void remove(int index);
108  void clear();
109 
111 
113  const std::vector<Blob> &detect(const core::Img8u &image);
114 
115  private:
117  struct Data;
118 
120  Data *m_data;
121  };
122 
123 
124  } // namespace cv
125 }
126 
int refColorIndex
corresponding ref color index
Definition: SimpleBlobSearcher.h:88
Data * m_data
internal data pointer
Definition: SimpleBlobSearcher.h:117
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
const ImageRegion * region
corresponding regions (provides access to region features)
Definition: SimpleBlobSearcher.h:82
core::Color refColor
corresponding reference color
Definition: SimpleBlobSearcher.h:85
Blob()
Definition: SimpleBlobSearcher.h:78
#define ICLCV_API
Definition: CompatMacros.h:177
Utility class for region-based colored blob detection.
Definition: SimpleBlobSearcher.h:73
Internal blob-result type.
Definition: SimpleBlobSearcher.h:77
ImageRegion Structure providing region feature information.
Definition: ImageRegion.h:99
ICLQt_API ImgQ thresh(const ImgQ &image, float threshold)
performs an image binarisation for each channel with given threshold
ICLQt_API void color(float r, float g=-1, float b=-1, float alpha=255)
sets the current color to given r,g,b,alpha value