Image Component Library (ICL)
RemainingPointsFeatureExtractor.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/RemainingPointsFeatureExtractor.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 <ICLMath/DynMatrix.h>
34 #include <ICLGeom/GeomDefs.h>
35 #include <ICLCore/DataSegment.h>
36 
37 namespace icl{
38  namespace geom{
39 
41 
44 
45  public:
46 
48 
59  static void apply(core::DataSegment<float,4> &xyz, const core::Img32f &depthImage, core::Img32s &labelImage, core::Img8u &maskImage,
60  std::vector<std::vector<int> > &surfaces, std::vector<std::vector<int> > &segments, int minSize=10, float euclideanDistance=5., int radius=6, float assignEuclideanDistance=5., int supportTolerance=9);
61 
63 
73  std::vector<std::vector<int> > &surfaces, std::vector<std::vector<int> > &segments, int minSize=10, float euclideanDistance=5., float assignEuclideanDistance=5., int supportTolerance=9);
74 
76 
87  std::vector<std::vector<int> > &surfaces, int minSize=10, float euclideanDistance=5., int radius=6, float assignEuclideanDistance=5.);
88 
90 
99  std::vector<std::vector<int> > &surfaces, int minSize=10, float euclideanDistance=5., float assignEuclideanDistance=5.);
100 
101  private:
102 
103  static void calculateLocalMinima(const core::Img32f &depthImage, core::Img8u &maskImage, int radius);
104 
105  static void clusterRemainingPoints(core::DataSegment<float,4> &xyz, std::vector<std::vector<int> > &surfaces, core::Img32s &labelImage, core::Img8u &maskImage,
106  int minSize, float euclideanDistance, int numCluster);
107 
108  static void detectNeighbours(core::DataSegment<float,4> &xyz, std::vector<std::vector<int> > &surfaces, core::Img32s &labelImage, std::vector<std::vector<int> > &neighbours,
109  std::vector<std::vector<int> > &neighboursPoints, int numCluster, float assignEuclideanDistance);
110 
111  static bool checkNotExist(int zw, std::vector<int> &nb, std::vector<int> &nbPoints);
112 
113  static void ruleBasedAssignment(core::DataSegment<float,4> &xyz, core::Img32s &labelImage, std::vector<std::vector<int> > &surfaces, std::vector<std::vector<int> > &segments,
114  std::vector<std::vector<int> > &neighbours, std::vector<std::vector<int> > &neighboursPoints, int numCluster, int supportTolerance);
115 
116  static std::vector<int> segmentMapping(std::vector<std::vector<int> > &segments, int numSurfaces);
117 
118  static int ransacAssignment(core::DataSegment<float,4> &xyz, std::vector<std::vector<int> > &surfaces, std::vector<int> &nb, int x);
119 
120  static bool checkSupport(core::Img32s &labelImage, std::vector<int> &surface, int neighbourID, int supportTolerance);
121  };
122 
123  } // namespace geom
124 }
ICLIO_API void labelImage(core::ImgBase *image, const std::string &label)
draws a label into the upper left image corner
undocument this line if you encounter any issues!
Definition: Any.h:37
static void ruleBasedAssignment(core::DataSegment< float, 4 > &xyz, core::Img32s &labelImage, std::vector< std::vector< int > > &surfaces, std::vector< std::vector< int > > &segments, std::vector< std::vector< int > > &neighbours, std::vector< std::vector< int > > &neighboursPoints, int numCluster, int supportTolerance)
static int ransacAssignment(core::DataSegment< float, 4 > &xyz, std::vector< std::vector< int > > &surfaces, std::vector< int > &nb, int x)
class for remaining points feature.
Definition: RemainingPointsFeatureExtractor.h:43
static void calculateLocalMinima(const core::Img32f &depthImage, core::Img8u &maskImage, int radius)
static bool checkSupport(core::Img32s &labelImage, std::vector< int > &surface, int neighbourID, int supportTolerance)
static void detectNeighbours(core::DataSegment< float, 4 > &xyz, std::vector< std::vector< int > > &surfaces, core::Img32s &labelImage, std::vector< std::vector< int > > &neighbours, std::vector< std::vector< int > > &neighboursPoints, int numCluster, float assignEuclideanDistance)
static void clusterRemainingPoints(core::DataSegment< float, 4 > &xyz, std::vector< std::vector< int > > &surfaces, core::Img32s &labelImage, core::Img8u &maskImage, int minSize, float euclideanDistance, int numCluster)
static bool checkNotExist(int zw, std::vector< int > &nb, std::vector< int > &nbPoints)
static std::vector< int > segmentMapping(std::vector< std::vector< int > > &segments, int numSurfaces)
static void apply(core::DataSegment< float, 4 > &xyz, const core::Img32f &depthImage, core::Img32s &labelImage, core::Img8u &maskImage, std::vector< std::vector< int > > &surfaces, std::vector< std::vector< int > > &segments, int minSize=10, float euclideanDistance=5., int radius=6, float assignEuclideanDistance=5., int supportTolerance=9)
Calculates and assigns the remaining points segments (including local minima separation).