-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmain.h
108 lines (99 loc) · 2.05 KB
/
main.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
#ifndef _MAIN_H_
#define _MAIN_H_
// Includes Opencv
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
// Includes CUDA
#include <cuda_runtime.h>
#include <cuda.h>
#include <cuda_runtime_api.h>
#include <cuda_texture_types.h>
#include <curand_kernel.h>
#include <vector_types.h>
// Includes STD libs
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <map>
#include <memory>
#include <chrono>
#include <iomanip>
#include <unordered_set>
#include <cstdarg>
#include <random>
#include <unordered_map>
// Includes Boost filesystem
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
// Define some const var
#define MAX_IMAGES 32
#define NEIGHBOUR_NUM 9
#define MAX_SEARCH_RADIUS 4096
#define DEBUG_POINT_X 753
#define DEBUG_POINT_Y 259
//#define DEBUG_COST_LINE
//#define DEBUG_NEIGHBOUR
using namespace boost::filesystem;
struct Camera {
float K[9];
float R[9];
float t[3];
float c[3];
int height;
int width;
float depth_min;
float depth_max;
};
struct PointList {
float3 coord;
float3 color;
};
enum RunState {
FIRST_INIT,
REFINE_INIT,
REFINE_ITER,
};
enum PixelState {
WEAK,
STRONG,
UNKNOWN
};
struct PatchMatchParams {
int max_iterations = 3;
int num_images = 5;
float sigma_spatial = 5.0f;
float sigma_color = 3.0f;
int top_k = 4;
float depth_min = 0.0f;
float depth_max = 1.0f;
bool geom_consistency = false;
int strong_radius = 5;
int strong_increment = 2;
int weak_radius = 5;
int weak_increment = 5;
bool use_APD = true;
int weak_peak_radius = 2;
int rotate_time = 4;
float ransac_threshold = 0.005;
float geom_factor = 0.2f;
RunState state;
};
struct Problem {
int index;
int ref_image_id;
std::vector<int> src_image_ids;
path dense_folder;
path result_folder;
int scale_size = 1;
PatchMatchParams params;
bool show_medium_result = false;
int iteration;
};
#endif // !_MAIN_H_