forked from GerhardR/kfusion
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinterface_mskinect.cpp
More file actions
91 lines (62 loc) · 1.48 KB
/
Copy pathinterface_mskinect.cpp
File metadata and controls
91 lines (62 loc) · 1.48 KB
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
#include "interface_mskinect.hpp"
#include <iostream>
struct CaptureThread {
void operator()() {
}
};
MSKinectDevice1::MSKinectDevice1()
: RGBD()
, gotDepth(false)
, die(false)
{
}
int MSKinectDevice1::open()
{
// buffers[0] = depth_buffer[0];
// buffers[1] = depth_buffer[1];
// rgb = rgb_buffer;
// depth_index = 0;
// gotDepth = false;
HRESULT hr;
m_hNextDepthFrameEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
m_hNextVideoFrameEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
hr = NuiCreateSensorByIndex(0, &m_pSensor);
if (FAILED(hr)) {
std::cerr << "MSKinect SDK: Could not open Device" << std::endl;
return 1;
}
hr = m_pSensor->NuiInitialize(NUI_INITIALIZE_FLAG_USES_COLOR | NUI_INITIALIZE_FLAG_USES_DEPTH);
hr = m_pSensor->NuiImageStreamOpen(
NUI_IMAGE_TYPE_COLOR,
NUI_IMAGE_RESOLUTION_640x480,
0,
2,
m_hNextVideoFrameEvent,
&m_pVideoStreamHandle);
hr = m_pSensor->NuiImageStreamOpen(
NUI_IMAGE_TYPE_DEPTH,
NUI_IMAGE_RESOLUTION_640x480,
0,
2,
m_hNextDepthFrameEvent,
&m_pDepthStreamHandle);
// colorpixels.resize(2 * 640 * 480);
// Start the Nui processing thread
m_hEvNuiProcessStop = CreateEvent(NULL, FALSE, FALSE, NULL);
//m_hThNuiProcess = CreateThread(NULL, 0, run, NULL, 0, NULL);
return 0;
}
bool MSKinectDevice1::available() const
{
return gotDepth;
}
int MSKinectDevice1::update()
{
return 0;
}
void MSKinectDevice1::setDepthBuffer() {
gotDepth = true;
}
void MSKinectDevice1::close()
{
}