Image Component Library (ICL)
ImageRegion.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/ImageRegion.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 
32 #pragma once
33 
34 #include <ICLUtils/CompatMacros.h>
36 #include <ICLUtils/Any.h>
37 #include <ICLCore/Img.h>
38 #include <ICLCV/RegionPCAInfo.h>
39 #include <ICLCV/LineSegment.h>
40 
41 namespace icl{
42  namespace cv{
44  struct ImageRegionPart;
45  struct ImageRegionData;
49 
100 
103 
105  template<class T> void calculateBoundaryIntern(const core::Img<T> &image) const;
106 
108  void calculateThinnedBoundaryIntern() const;
109 
111  utils::Point getUpperLeftPixel()const;
112 
113  public:
114 
117  m_data(data){}
118 
120  friend class RegionDetector;
121 
123 
124  inline operator bool() const { return m_data; }
125 
127  ImageRegionData *data() { return m_data; }
128 
130  const ImageRegionData *data() const { return m_data; }
131 
133  void sample(core::ImgBase *image, int color);
134 
136  void sample(core::ImgBase *image, const std::vector<int> &channelColors);
137 
139  int getSize() const;
140 
142  int getVal() const;
143 
145  int getID() const;
146 
148  utils::Point32f getCOG() const;
149 
151  const std::vector<LineSegment> &getLineSegments() const;
152 
154  const utils::Rect &getBoundingBox() const;
155 
157  const RegionPCAInfo &getPCAInfo() const;
158 
160  const std::vector<utils::Point> &getBoundary(bool thinned=true) const;
161 
163  int getBoundaryPointCount(bool thinned) const;
164 
166 
172  float getBoundaryLength() const;
173 
175 
179  const std::vector<utils::Point32f> &getBoundaryCorners() const;
180 
181 
183 
196  float getFormFactor() const;
197 
199 
201  const std::vector<utils::Point> &getPixels() const;
202 
204  void drawTo(const core::ImgBase *image, icl64f val) const;
205 
207 
208  void drawToColor(const core::ImgBase *image, const icl64f *color) const;
209 
211 
220  const std::vector<ImageRegion> &getSubRegions(bool directOnly=true) const ;
221 
223 
224  const ImageRegion &getParentRegion() const ;
225 
227 
230  const std::vector<ImageRegion> &getParentTree() const ;
231 
233 
234  const std::vector<ImageRegion> &getNeighbours() const ;
235 
237  bool isBorderRegion() const ;
238 
240  bool contains(const utils::Point &p) const;
241 
243  void showTree() const;
244 
246 
253  void setMetaData(const utils::Any &any) const;
254 
256  const utils::Any &getMetaData() const;
257  };
258 
259  } // namespace cv
260 }
261 
undocument this line if you encounter any issues!
Definition: Any.h:37
ImageRegion(ImageRegionData *data=0)
Null-construktor.
Definition: ImageRegion.h:116
ICLQt_API ImgROI data(ImgQ &r)
creates full ROI ROI-struct
#define ICLCV_API
Definition: CompatMacros.h:177
Ipp64f icl64f
64Bit floating point type for the ICL
Definition: BasicTypes.h:52
ImageRegionData * m_data
Internally handled data (not shallow copied, but simply linked to the real data that is managed by th...
Definition: ImageRegion.h:102
ImageRegion Structure providing region feature information.
Definition: ImageRegion.h:99
Complex utility class for detection of connected image components.
Definition: RegionDetector.h:179
Single precission 3D Vectors Point class of the ICL.
Definition: Point32f.h:41
Utility class for shallow copied data of image region class.
Definition: ImageRegionData.h:50
Point class of the ICL used e.g. for the Images ROI offset.
Definition: Point.h:58
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
const ImageRegionData * data() const
returns the internal data (do not use!) (const)
Definition: ImageRegion.h:130
ImageRegionData * data()
returns the internal data (do not use!)
Definition: ImageRegion.h:127
Rectangle class of the ICL used e.g. for the Images ROI-rect.
Definition: Rect.h:95
Simple generic data type implementation that uses a string based data representation.
Definition: Any.h:109
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
data-struct to represent local PCA information
Definition: RegionPCAInfo.h:39