-
Notifications
You must be signed in to change notification settings - Fork 11
/
Register.h
94 lines (76 loc) · 2.98 KB
/
Register.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
#pragma once
#include "Display/DrawObject.h"
#include "Helpers/xUtils.h"
#include <cuda_gl_interop.h>
#include <xDeformation.h>
#include <InputData.h>
/*namespace ConstantColor
{
cv::Vec4b constantColor[10] = { cv::Vec4b(255, 128,128,255), cv::Vec4b(255, 255,128,255), cv::Vec4b(128, 255,128,255), cv::Vec4b(0, 128,255,255),cv::Vec4b(128, 128,192,255),
cv::Vec4b(128, 64,64,255), cv::Vec4b(0, 128,128,255), cv::Vec4b(128, 255,64,255), cv::Vec4b(128, 128,128,255), cv::Vec4b(192, 192,192,255) };
};*/
class Register
{
public:
Register();
~Register();
void CreateDeformation(int _vbo_id, std::vector<int> _sum_vertex_num);
//void RegisterRun(int _frag_id, std::vector<int> _sum_vertex_num);
void FindCorrespondencePoints(std::vector<cv::Mat_<float>> &_camera_pose,
std::vector<cv::Mat_<float>> &_camera_fxfycxcy,
int _method, float _dist_thresh1, float _dist_thresh2, float _angle_thresh,
int _width, int _height);
void RegisterRun(int _iter_num, std::vector<int> _sum_vertex_num,
std::vector<cv::Mat_<float>> &_camera_pose,
std::vector<cv::Mat_<float>> &_camera_fxfycxcy,
int _method, float _dist_thresh1, float _dist_thresh2, float _angle_thresh,
int _width, int _height);
void CalcEachFragColor();
void CopyData();
std::vector<cv::Vec4f>& get_nodes();
std::vector<cv::Vec4f>& get_deformed();
std::vector<cv::Vec4b>& get_deformed_color();
std::vector<cv::Vec4f>& get_deformed_normal();
std::vector<cv::Vec4f>& get_source();
std::vector<cv::Vec4b>& get_source_color();
std::vector<cv::Vec4f>& get_source2deformed_vertex();
std::vector<int>& get_source2deformed_index();
std::vector<cv::Vec4b>& get_source2deformed_color();
std::vector<cv::Vec4f>& get_corr_vertex();
std::vector<cv::Vec4b>& get_corr_color();
std::vector<int>& get_corr_index();
std::vector<cv::Vec4f>& get_deformed_sample_vertex();
std::vector<cv::Vec4b>& get_deformed_sample_color();
std::vector<cv::Vec4f>& get_source_sample_vertex();
std::vector<cv::Vec4b>& get_source_sample_color();
private:
xDeformation *deform_;
int vbo_id_;
int frag_id_;
VBOType *vbo_;
struct cudaGraphicsResource* vbo_CUDA_;
int frag_num_;
std::vector<int> sum_vertex_num_;
float imgScale, dispScal;
int depthWidth, depthHeight, colorWidth, colorHeight;
float fx, fy, cx, cy;
cv::Mat color_;
cv::Mat full_color_;
cv::Mat_<uchar> gray_;
cv::cuda::GpuMat d_gray_;
std::vector<cv::Vec4f> h_nodes_;
std::vector<cv::Vec4f> h_deformed_;
std::vector<cv::Vec4f> h_deformed_normal_;
std::vector<cv::Vec4f> h_source_;
std::vector<cv::Vec4b> h_color_;
std::vector<cv::Vec4f> h_deformed_sample_vertex_;
std::vector<cv::Vec4b> h_deformed_sample_color_;
std::vector<cv::Vec4f> h_source_sample_vertex_;
std::vector<cv::Vec4b> h_source_sample_color_;
std::vector<cv::Vec4f> h_source2deformed_vertex_;
std::vector<int> h_source2deformed_index_;
std::vector<cv::Vec4b> h_source2deformed_color_;
std::vector<cv::Vec4f> h_corr_vertex_;
std::vector<cv::Vec4b> h_corr_color_;
std::vector<int> h_corr_index_;
};