-
Notifications
You must be signed in to change notification settings - Fork 7
/
type.h
183 lines (154 loc) · 4.89 KB
/
type.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#pragma once
#include <Eigen/Core>
#include <vector>
namespace ppf {
struct API_PUBLIC BoundingBox {
public:
Eigen::Vector3f min;
Eigen::Vector3f max;
BoundingBox();
BoundingBox(Eigen::Vector3f min, Eigen::Vector3f max);
BoundingBox &operator=(const BoundingBox &rhs);
Eigen::Vector3f size() const;
Eigen::Vector3f center() const;
float diameter() const;
};
struct API_PUBLIC PointCloud {
public:
std::vector<Eigen::Vector3f> point;
std::vector<Eigen::Vector3f> normal;
std::vector<Eigen::Vector3i> face;
BoundingBox box;
Eigen::Vector3f viewPoint = Eigen::Vector3f(NAN, NAN, NAN);
bool hasNormal() const;
std::size_t size() const;
bool empty() const;
};
/**
* @brief additional parameter for training model
*
*/
struct API_PUBLIC TrainParam {
public:
/**
* @brief Set the discretion distance of the point pair distance
* relative to the object's diameter
*/
float featDistanceStepRel;
/**
* @brief Set the discretion of the point pair orientation as the number
* of subdivisions of the angle
*/
int featAngleResolution;
/**
* @brief Set the sampling distance for the pose refinement relative to the object's diameter
*
*/
float poseRefRelSamplingDistance;
/**
* @brief Set the count of nearest neighbors to estimate normal
*
*/
int knnNormal;
/**
* @brief Enables or disables smooth normal by neighbors
*
*/
bool smoothNormal;
explicit TrainParam(float featDistanceStepRel = 0.04f, int featAngleResolution = 30,
float poseRefRelSamplingDistance = 0.01f, int knnNormal = 10,
bool smoothNormal = true);
};
/**
* @brief additional parameter for matching scene
*
*/
struct API_PUBLIC MatchParam {
public:
/**
* @brief Sets the maximum number of matches that are returned
*
*/
int numMatches;
/**
* @brief Set the count of nearest neighbors to estimate normal
*
*/
int knnNormal;
/**
* @brief Enables or disables smooth normal by neighbors
*
*/
bool smoothNormal;
/**
* @brief Invert the orientation of the scene
*
*/
bool invertNormal;
/**
* @brief The minimum distance between the centers of the axis-aligned bounding boxes of two
* matches. The value is set relative to the diameter of the object.
*
*/
float maxOverlapDistRel;
/**
* @brief This parameter has the same effect as the parameter 'maxOverlapDistRel'. Note that
* in contrast to 'maxOverlapDistRel', the value for 'maxOverlapDistAbs' is set as an
* absolute value
*
*/
float maxOverlapDistAbs;
/**
* @brief Enables or disables the sparse pose refinement
*
*/
bool sparsePoseRefinement;
/**
* @brief Enables or disables the dense pose refinement.
*
*/
bool densePoseRefinement;
/**
* @brief Number of iterations for the dense pose refinement.
*
*/
int poseRefNumSteps;
/**
* @brief Set the distance threshold for dense pose refinement relative to the diameter of the
* surface model. Only scene points that are closer to the object than this distance are used
* for the optimization. Scene points further away are ignored.
*
*/
float poseRefDistThresholdRel;
/**
* @brief This parameter has the same effect as the parameter 'poseRefDistThresholdRel'. Note
* that in contrast to 'poseRefDistThresholdRel', the value for 'poseRefDistThresholdAbs' is set
* as an absolute value
*
*/
float poseRefDistThresholdAbs;
/**
* @brief Set the distance threshold for scoring relative to the diameter of the surface model
*
*/
float poseRefScoringDistRel;
/**
* @brief Set the distance threshold for scoring. Only scene points that are closer to the
* object than this distance are considered to be 'on the model' when computing the score after
* the pose refinement. All other scene points are considered not to be on the model. The value
* should correspond to the amount of noise on the coordinates of the scene points.
*
*/
float poseRefScoringDistAbs;
explicit MatchParam(int numMatches = 1, int knnNormal = 10, bool smoothNormal = true,
bool invertNormal = false, float maxOverlapDistRel = 0.5f,
float maxOverlapDistAbs = 0, bool sparsePoseRefinement = true,
bool densePoseRefinement = true, int poseRefNumSteps = 5,
float poseRefDistThresholdRel = 0.1f, float poseRefDistThresholdAbs = 0,
float poseRefScoringDistRel = 0.01f, float poseRefScoringDistAbs = 0);
};
struct MatchResult {
PointCloud sampledScene;
PointCloud keyPoint;
};
} // namespace ppf