-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathOpenNIEngine.h
54 lines (39 loc) · 1.35 KB
/
OpenNIEngine.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
#pragma once
#include<opencv2/opencv.hpp>
#include <OpenNI.h>
class OpenNIEngine
{
struct DeviceData{
openni::Device device;
openni::VideoStream depthStream;
openni::VideoStream colorStream;
openni::VideoStream IRStream;
openni::VideoFrameRef depthFrame;
openni::VideoFrameRef colorFrame;
openni::VideoFrameRef IRFrame;
openni::VideoStream **streams;
};
private:
DeviceData openni_device_data;
cv::Size image_size_rgb;
cv::Size image_size_depth;
bool color_available;
bool depth_available;
bool ir_available;
cv::Mat tmp_ir_image;
cv::Mat tmp_RGB_image;
void initRGBDStreams( const bool use_internal_calibration,
cv::Size requested_size_rgb,
cv::Size requested_size_d);
public:
OpenNIEngine(
const char *device_URI = NULL,
const bool use_internal_calibration = false,
cv::Size requested_size_rgb = cv::Size(640,480),
cv::Size requested_size_d = cv::Size(640,480));
~OpenNIEngine();
void shotGrayAndIRImages(cv::Mat& gray, cv::Mat& ir);
void getRGBDImages(cv::Mat& rgb, cv::Mat& raw_depth);
cv::Size getDepthImageSize(void);
cv::Size getRGBImageSize(void);
};