-
Notifications
You must be signed in to change notification settings - Fork 94
/
camera.h
52 lines (50 loc) · 1.66 KB
/
camera.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
#pragma once
#include "managed.h"
#include <vector_types.h>
class Camera_cu : public Managed {
public:
float* P;
/*float* P_col3;*/
float4 P_col34;
float* P_inv;
float* M_inv;
float* R;
/*float* t;*/
float4 t4;
/*float* C;*/
float4 C4;
float fx;
float fy;
float f;
float alpha;
float baseline;
bool reference;
float depthMin; //this could be figured out from the bounding volume (not done right now, but that's why this parameter is here as well and not only in AlgorithmParameters)
float depthMax; //this could be figured out from the bounding volume (not done right now, but that's why this parameter is here as well and not only in AlgorithmParameters)
//int id; //corresponds to the image name id (eg. 0-10), independent of order in argument list, just dependent on name
char* id;
float* K;
float* K_inv;
Camera_cu()
{
baseline = 0.54f;
reference = false;
depthMin = 2.0f; //this could be figured out from the bounding volume (not done right now, but that's why this parameter is here as well and not only in AlgorithmParameters)
depthMax = 20.0f;
cudaMallocManaged (&P, sizeof(float) * 4 * 4);
cudaMallocManaged (&P_inv, sizeof(float) * 4 * 4);
cudaMallocManaged (&M_inv, sizeof(float) * 4 * 4);
cudaMallocManaged (&K, sizeof(float) * 4 * 4);
cudaMallocManaged (&K_inv, sizeof(float) * 4 * 4);
cudaMallocManaged (&R, sizeof(float) * 4 * 4);
}
~Camera_cu()
{
cudaFree (P);
cudaFree (P_inv);
cudaFree (M_inv);
cudaFree (K);
cudaFree (K_inv);
cudaFree (R);
}
};