-
Notifications
You must be signed in to change notification settings - Fork 1
/
PointLayer.h
52 lines (40 loc) · 1.47 KB
/
PointLayer.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
#ifndef GPU_ORB_TRACKER_POINTLAYER_H
#define GPU_ORB_TRACKER_POINTLAYER_H
#include "Layer.h"
#include "PointCloud.h"
#include "nanoflann.hpp"
#include "Feature.h"
#include "VectorCloud.h"
// Nanoflann point cloud indexing tree
typedef nanoflann::KDTreeSingleIndexAdaptor<
nanoflann::L2_Simple_Adaptor<float, PointCloud>,
PointCloud, 2> Point2DTree;
// Nanoflann vector cloud indexing tree
typedef nanoflann::KDTreeSingleIndexAdaptor<
nanoflann::L2_Simple_Adaptor<float, VectorCloud>,
VectorCloud, 2> Vector2DTree;
class PointLayer : public Layer {
// Point cloud storage
PointCloud new_frame;
Point2DTree *new_frame_index;
// Vector cloud storage
VectorCloud last_vectors;
Vector2DTree *last_vectors_index;
public:
// List of active features
std::list<Feature> active;
PointLayer() {
// Initialization of indexes
new_frame_index = new Point2DTree(2, new_frame, nanoflann::KDTreeSingleIndexAdaptorParams(5));
last_vectors_index = new Vector2DTree(2, last_vectors, nanoflann::KDTreeSingleIndexAdaptorParams(2));
}
~PointLayer() {
delete new_frame_index;
delete last_vectors_index;
}
void initialize(const std::vector<cv::KeyPoint> &points, const cv::Mat &desc, unsigned int i_start,
unsigned int i_end) override;
void estimate(float *in, float *out) override;
void pair(Layer *layer_above) override;
};
#endif //GPU_ORB_TRACKER_POINTLAYER_H