-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMapPoint.h
60 lines (43 loc) · 1.45 KB
/
MapPoint.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
//
// Created by pidan1231239 on 18-6-13.
//
#ifndef SFM_LEARN_MAPPOINT_H
#define SFM_LEARN_MAPPOINT_H
#include "common_include.h"
#include "Frame.h"
#include <utility>
namespace sky {
class MapPoint {
public:
typedef shared_ptr<MapPoint> Ptr;
Mat descriptor; // Descriptor for matching
list<std::pair<Frame::Ptr,cv::Point2d>> observedFrames;//观测帧和像素坐标
Vector3d pos; // Position in world
Vec3b rgb;
MapPoint();
MapPoint(const Vector3d &pos, const Mat &descriptor, const Vec3b &rgb) :
pos(pos),
descriptor(descriptor),
rgb(rgb) {}
template <typename T>
cv::Point3_<T> getPosPoint3_CV() const {
return cv::Point3_<T>(pos(0, 0), pos(1, 0), pos(2, 0));
}
template <typename T>
cv::Matx<T,1,3> getPosMatx13() const{
return cv::Matx<T,1,3>(pos(0, 0), pos(1, 0), pos(2, 0));
};
template <typename T>
void setPos(cv::Matx<T,1,3> posMatx13){
pos(0)=posMatx13(0);
pos(1)=posMatx13(1);
pos(2)=posMatx13(2);
}
void addObervedFrame(const Frame::Ptr &observedFrame,const cv::Point2d &pixelCoor) {
if (observedFrame)
observedFrames.push_back(
std::pair<Frame::Ptr,cv::Point2d>(observedFrame,pixelCoor));
}
};
}
#endif //SFM_LEARN_MAPPOINT_H