-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathDfUSMC.hpp
68 lines (57 loc) · 1.71 KB
/
DfUSMC.hpp
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
//
// DfUSMC.hpp
// DfUSMC
//
// Created by Hyowon Ha on 2016. 6. 11..
// Copyright © 2016 Hyowon Ha. All rights reserved.
//
#ifndef DfUSMC_hpp
#define DfUSMC_hpp
#include <stdio.h>
#include <vector>
#include "opencv2/opencv.hpp"
#include "ceres/ceres.h"
#include <time.h>
#include "qx_basic.h"
#include "qx_tree_upsampling.h"
using namespace std;
using namespace cv;
class DfUSMC
{
public:
DfUSMC() {}
~DfUSMC() {
delete[] poses;
delete[] inv_depths;
}
void LoadSmallMotionClip(char *fullpath);
void SaveReferenceImage(char *fullpath);
void FeatureExtractionAndTracking();
void BundleAdjustment(double f_init, double k1_init, double k2_init); // bundle adjustment with given initial parameters
void BundleAdjustment(); // no input -> use our initial parameters
void SavePointCloudPLY(char *fullpath);
void UndistortImages();
void DenseMatching(double scale, int num_label, double lambda, double sigma);
void SaveDepthmapWTA(char *fullpath, bool redistort);
void SaveDepthmapFiltered(char *fullpath, bool redistort);
void SaveDepthmapRefined(char *fullpath, bool redistort);
private:
std::vector<Mat> images;
int num_image;
int image_width;
int image_height;
Mat features;
int num_feature;
Mat ud_mapx, ud_mapy; // undistorted->distorted mapping for dense matching
Mat du_mapx, du_mapy; // distorted->undistorted mapping for final visualization
Mat confidencemap;
Mat depthmapWTA;
Mat depthmapFiltered; // outlier removal
Mat depthmapRefined;
double cx, cy;
double f, k1, k2;
double f_new;
double *poses;
double *inv_depths;
};
#endif /* DfUSMC_hpp */