-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathjointtgconfig.h
100 lines (85 loc) · 2.66 KB
/
jointtgconfig.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
/**
* @author fyp
*/
#ifndef JOINTTGCONFIG_H
#define JOINTTGCONFIG_H
#include <iostream>
#include <opencv2/opencv.hpp>
class JointTGConfig
{
public:
static const JointTGConfig & get()
{
static const JointTGConfig instance;
return instance;
}
public:
float IMAGE_FX;
float IMAGE_FY;
float IMAGE_CX;
float IMAGE_CY;
float DEPTH_FX;
float DEPTH_FY;
float DEPTH_CX;
float DEPTH_CY;
int DEPTH_WIDTH;
int DEPTH_HEIGHT;
int IMAGE_WIDTH;
int IMAGE_HEIGHT;
int EXTERNAL_ITER_NUM;//the iteration number of the external loop;
int TEX_ITER_NUM;//the iteration number of texture optimizaiton
int GEO_ITER_NUM;//the iteration number of geometry optimizaiton
int ILLUM_ITER_NUM;//the iteration number of illumination consistency optimizaiton
float lambda_c;
float lambda_d;
float lambda_H;
float lambda_L;
float lambda_R;
float lambda_hb;
private:
JointTGConfig()
: EXTERNAL_ITER_NUM(3),
TEX_ITER_NUM(50),
ILLUM_ITER_NUM(10),
GEO_ITER_NUM(20),
lambda_c(1.0f),
lambda_d(100.0f),
lambda_H(10000.0f),
lambda_L(1000.0f),
lambda_R(1000.0f),
lambda_hb(0.2f)
{
cv::FileStorage fs2("../Config/config.yml", cv::FileStorage::READ);
if(!fs2.isOpened())
{
std::cout << "Failed to open settings file at: " << std::endl;
}
//depth
fs2["depth_fx"]>>DEPTH_FX;
fs2["depth_fy"]>>DEPTH_FY;
fs2["depth_cx"]>>DEPTH_CX;
fs2["depth_cy"]>>DEPTH_CY;
fs2["depth_width"]>>DEPTH_WIDTH;
fs2["depth_height"]>>DEPTH_HEIGHT;
std::cout<<"depth fx:"<<DEPTH_FX<<" fy:"<<DEPTH_FY<<" cx:"<<DEPTH_CX<<" cy:"<<DEPTH_CY<<" width:"<<DEPTH_WIDTH<<" height:"<<DEPTH_HEIGHT<<std::endl;
//rgb
fs2["RGB_fx"]>>IMAGE_FX;
fs2["RGB_fy"]>>IMAGE_FY;
fs2["RGB_cx"]>>IMAGE_CX;
fs2["RGB_cy"]>>IMAGE_CY;
fs2["RGB_width"]>>IMAGE_WIDTH;
fs2["RGB_height"]>>IMAGE_HEIGHT;
std::cout<<"RGB fx:"<<IMAGE_FX<<" fy:"<<IMAGE_FY<<" cx:"<<IMAGE_CX<<" cy:"<<IMAGE_CY<<" width:"<<IMAGE_WIDTH<<" height:"<<IMAGE_HEIGHT<<std::endl;
fs2["external_Iterations"]>>EXTERNAL_ITER_NUM;
fs2["texture_Iterations"]>>TEX_ITER_NUM;
fs2["illum_Iterations"]>>ILLUM_ITER_NUM;
fs2["geometry_Iterations"]>>GEO_ITER_NUM;
fs2["lambda_c"]>>lambda_c;
fs2["lambda_d"]>>lambda_d;
fs2["lambda_H"]>>lambda_H;
fs2["lambda_L"]>>lambda_L;
fs2["lambda_R"]>>lambda_R;
fs2["lambda_hb"]>>lambda_hb;
}
};
#endif // JOINTTGCONFIG_H