Image Component Library (ICL)
SurfaceFeatureExtractor.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/SurfaceFeatureExtractor.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 <ICLGeom/GeomDefs.h>
34 #include <ICLCore/DataSegment.h>
35 #include <ICLCore/Img.h>
36 
37 namespace icl{
38  namespace geom{
39 
41 
44 
45  public:
46  enum Mode {
53  ALL = 63
54  };
55 
56 
57  typedef struct{
58  int numPoints;//number of surface points
59  core::Img32f normalHistogram;//normal histogram (11x11 bins representing x and y component (each from -1 to 1 in 0.2 steps)
60  core::Channel32f normalHistogramChannel;
61  Vec meanNormal;//mean normal
62  Vec meanPosition;//mean position
63  int curvatureFactor;//curvature Factor from enum CurvatureFactor
64  std::pair<Vec,Vec> boundingBox3D;
65  std::pair<utils::Point,utils::Point> boundingBox2D;
66  float volume;//volume of the 3D bounding box
68 
69 
72  PLANAR=1,
75  };
76 
77 
79 
84  static SurfaceFeature apply(std::vector<Vec> &points, std::vector<Vec> &normals, int mode=ALL);
85 
87 
93  static std::vector<SurfaceFeature> apply(core::Img32s labelImage, core::DataSegment<float,4> &xyzh, core::DataSegment<float,4> &normals, int mode=ALL);
94 
96 
100  static float matchNormalHistograms(core::Img32f &a, core::Img32f &b);
101 
102  private:
103 
104  static SurfaceFeature getInitializedStruct();
105  static void update(Vec &normal, Vec &point, SurfaceFeature &feature, int mode, int x=0, int y=0);
106  static void finish(SurfaceFeature &feature, int mode);
107  };
108 
109  } // namespace geom
110 }
Vec meanPosition
Definition: SurfaceFeatureExtractor.h:62
Definition: SurfaceFeatureExtractor.h:73
Definition: SurfaceFeatureExtractor.h:47
static void finish(SurfaceFeature &feature, int mode)
ICLIO_API void labelImage(core::ImgBase *image, const std::string &label)
draws a label into the upper left image corner
int numPoints
Definition: SurfaceFeatureExtractor.h:58
undocument this line if you encounter any issues!
Definition: Any.h:37
core::Channel32f normalHistogramChannel
Definition: SurfaceFeatureExtractor.h:60
Definition: SurfaceFeatureExtractor.h:72
core::Img32f normalHistogram
Definition: SurfaceFeatureExtractor.h:59
Definition: SurfaceFeatureExtractor.h:51
Definition: SurfaceFeatureExtractor.h:74
Mode
Definition: SurfaceFeatureExtractor.h:46
Definition: SurfaceFeatureExtractor.h:48
float volume
Definition: SurfaceFeatureExtractor.h:66
Vec meanNormal
Definition: SurfaceFeatureExtractor.h:61
CurvatureFactor
Definition: SurfaceFeatureExtractor.h:70
Definition: SurfaceFeatureExtractor.h:57
Definition: SurfaceFeatureExtractor.h:50
Definition: SurfaceFeatureExtractor.h:53
static SurfaceFeature getInitializedStruct()
class for extraction of surface features.
Definition: SurfaceFeatureExtractor.h:43
Definition: SurfaceFeatureExtractor.h:52
static SurfaceFeature apply(std::vector< Vec > &points, std::vector< Vec > &normals, int mode=ALL)
Applies the surface feature calculation for one single surface (please note: no BoundingBox2D)
Definition: SurfaceFeatureExtractor.h:49
static float matchNormalHistograms(core::Img32f &a, core::Img32f &b)
Calculates the matching score between 0 and 1 for two normal histograms.
std::pair< Vec, Vec > boundingBox3D
Definition: SurfaceFeatureExtractor.h:64
std::pair< utils::Point, utils::Point > boundingBox2D
Definition: SurfaceFeatureExtractor.h:65
Definition: SurfaceFeatureExtractor.h:71
static void update(Vec &normal, Vec &point, SurfaceFeature &feature, int mode, int x=0, int y=0)
int curvatureFactor
Definition: SurfaceFeatureExtractor.h:63