Image Component Library (ICL)
FeatureGraphSegmenter.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 : ICLGeom/src/ICLGeom/FeatureGraphSegmenter.h **
10 ** Module : ICLGeom **
11 ** Authors: Andre Ueckermann **
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 <ICLCore/DataSegment.h>
36 
37 namespace icl{
38  namespace geom{
42 
43  public:
44 
45  enum Mode {BEST, GPU, CPU};
46 
48 
50  FeatureGraphSegmenter(Mode mode=BEST);
51 
54 
56 
67  core::Img8u apply(core::DataSegment<float,4> xyz, const core::Img8u &edgeImg, const core::Img32f &depthImg,
68  core::DataSegment<float,4> normals=NULL, bool stabelize=true, bool useROI=false,
69  bool useCutfreeAdjacency=true, bool useCoplanarity=true, bool useCurvature=true, bool useRemainingPoints=true);
70 
72 
87  std::vector<PointCloudSegmentPtr> applyHierarchical(core::DataSegment<float,4> xyz, core::DataSegment<float,4> rgb, const core::Img8u &edgeImg, const core::Img32f &depthImg,
88  core::DataSegment<float,4> normals=NULL, bool useROI=false,
89  bool useCutfreeAdjacency=true, bool useCoplanarity=true, bool useCurvature=true, bool useRemainingPoints=true,
90  float weightCutfreeAdjacency=1.0, float weightCoplanarity=0.9, float weightCurvature=0.8, float weightRemainingPoints=0.7);
91 
93 
99  void setROI(float xMin, float xMax, float yMin, float yMax, float zMin, float zMax);
100 
102 
103  void setMinSurfaceSize(unsigned int size);
104 
106 
108  void setAssignmentParams(float distance, int radius);
109 
111 
115  void setCutfreeParams(float euclideanDistance, int passes, int tolerance, float minAngle);
116 
118 
123  void setCoplanarityParams(float maxAngle, float distanceTolerance, float outlierTolerance, int numTriangles, int numScanlines);
124 
126 
134  void setCurvatureParams(float histogramSimilarity, bool useOpenObjects, int maxDistance, bool useOccludedObjects, float maxError,
135  int ransacPasses, float distanceTolerance, float outlierTolerance);
136 
138 
143  void setRemainingPointsParams(int minSize, float euclideanDistance, int radius, float assignEuclideanDistance, int supportTolerance);
144 
146 
147  void setGraphCutThreshold(float threshold);
148 
149  std::vector<SurfaceFeatureExtractor::SurfaceFeature> getSurfaceFeatures();
150 
152 
153  std::vector<std::vector<int> > getSegments();
154 
156 
157  std::vector<std::vector<int> > getSurfaces();
158 
160 
162  core::Img32s getLabelImage(bool stabelize);
163 
165 
167  core::Img8u getColoredLabelImage(bool stabelize);
168 
170 
171  core::Img8u getMaskImage();
172 
173  private:
174 
175  void surfaceSegmentation(core::DataSegment<float,4> &xyz, const core::Img8u &edgeImg, const core::Img32f &depthImg, int minSurfaceSize=25, bool useROI=false);
176 
177  std::vector<PointCloudSegmentPtr> createHierarchy(math::DynMatrix<float> &probabilityMatrix, core::DataSegment<float,4> &xyz, core::DataSegment<float,4> &rgb);
178 
179  struct Data;
180  Data *m_data;
181 
182  };
183  } // namespace geom
184 }
undocument this line if you encounter any issues!
Definition: Any.h:37
ICLQt_API ImgQ rgb(const ImgQ &image)
converts a given image to formatRGB
#define ICLGeom_API
Definition: CompatMacros.h:179
Mode
Definition: FeatureGraphSegmenter.h:45
Definition: FeatureGraphSegmenter.h:41
Data * m_data
internal data type
Definition: FeatureGraphSegmenter.h:179