-
Notifications
You must be signed in to change notification settings - Fork 4
/
coreslam.h
82 lines (66 loc) · 2.75 KB
/
coreslam.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
#ifndef CORESLAM_H
#define CORESLAM_H
#include "opencv/highgui.h"
#include <iostream>
#include "FeaturesDetector/ifeaturedetector.h"
#include "FeaturesMatcher/ifeaturematching.h"
#include "TransformationCalculator/irtfinder.h"
#include "MatchesFilter/imatchesfilter.h"
#include "FeaturesDetector/featuredetectorsurf.h"
#include "FeaturesMatcher/featurematcherflann.h"
#include "TransformationCalculator/rtfindertrilateration.h"
#include "MatchesFilter/matchesfiltercvteam.h"
#include "luxframe.hpp"
#include "matchpoints.h"
#include "BundleAdjustment/opencvboundleadjustment.h"
namespace LuxSlam
{
/** Sequence diagram for main function run()
\msc
hscale="1.5";
CoreSlam, IFeatureDetector, IFeatureMatching, IMatchesFilter, IRTFinder, Logger;
|||;
CoreSlam->IFeatureDetector [label="getFeatures", URL="\ref IFeatureDetector::getFeatures()", ID="1"];
CoreSlam<-IFeatureDetector [label="return features"];
CoreSlam->IFeatureMatching [label="getMatches", URL="\ref IFeatureMatching::getMatches()", ID="2"];
CoreSlam<-IFeatureMatching [label="return matches"];
CoreSlam->IMatchesFilter [label="filterMatches", URL="\ref IMatchesFilter::filterMatches()", ID="3"];
CoreSlam<-IMatchesFilter [label="return filtered matches"];
CoreSlam->IRTFinder [label="calculate transformation", URL="\ref IRTFinder::getRTVector()", ID="4"];
CoreSlam<-IRTFinder [label="return transformation matrix"];
CoreSlam->Logger [label="get logger reference", URL="\ref Logget::getInstance()", ID="5"];
CoreSlam<-Logger [label="return logger reference"];
CoreSlam->Logger [label="logging some calculated data", URL="\ref Logget::logCamera()", ID="6"];
CoreSlam<-Logger [label=""];
\endmsc
*/
class CoreSlam
{
public:
/// default constructor
CoreSlam();
/// run slam algorithm
/**
\param frame - image from kinect
*/
void run(LuxFrame* frame);
private:
IFeatureDetector *fdetector;
IFeatureMatching *fmatcher;
IRTFinder *rtfinder;
IMatchesFilter *ffilter;
LuxFrame *prev_frame;
LuxFrame *curr_frame;
FPoints *prev_features;
FPoints *curr_features;
OpenCVBoundleAdjustemnt* bundle_adjusment;
Triple global_transformation_vector;
/// get 3d coordinates of matches points
/**
\param matches - matche points
\param points - output vector fill 2d and 3d coordinates for each match point
*/
void Get3dPointsOfMatches(const std::vector<cv::DMatch>& matches, std::vector<MatchPoints>& points);
};
}
#endif // CORESLAM_H