-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDrawCameraView.h
More file actions
executable file
·107 lines (85 loc) · 3.39 KB
/
DrawCameraView.h
File metadata and controls
executable file
·107 lines (85 loc) · 3.39 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/**
* @file DrawCameraView.h
* @ingroup Drawing Kinect
* @author Dominique Vaufreydaz, Grenoble Alpes University, Inria
* @copyright All right reserved.
*/
#ifndef __DRAW_CAMERA_VIEW_H__
#define __DRAW_CAMERA_VIEW_H__
#include "DrawRawData.h"
#define VideoFileName "/video/video.timestamp" /*!< @brief Timestamp file for the video input from Kinect1 or Kinect2 */
#define RawVideoFileName "/video/video.raw" /*!< @brief Raw file for the video input from Kinect1 or Kinect2 */
#ifdef KINECT_1
namespace MobileRGBD { namespace Kinect1 {
/**
* @class DrawCameraView DrawCameraView.cpp DrawCameraView.h
* @brief Class to draw video stream from the Kinect1 data.
*
* @author Dominique Vaufreydaz, Grenoble Alpes University, Inria
*/
class DrawCameraView : public DrawRawData
{
public:
/** @brief constructor. Draw data from the video stream of the Kinect1.
*
* @param Folder [in] Main folder containing the data. Body data will be search in 'Folder/video/' subfolder.
* @param SizeOfFrame [in] Size of each frame. Default value = CamWidth*CamHeight*CamBytesPerPixel.
*/
DrawCameraView( const std::string& Folder, int SizeOfFrame = CamWidth*CamHeight*CamBytesPerPixel )
: DrawRawData( Folder + VideoFileName, Folder + RawVideoFileName, SizeOfFrame )
{
StartingFrame = 0;
}
/** @brief Virtual destructor, always.
*/
~DrawCameraView() {};
/** @brief ProcessElement is a callback function called by mother classes when data are ready.
*
* @param RequestTimestamp [in] The timestamp of the data.
* @param UserData [in] User pointer to working data. Here a pointer to a cv:Mat to draw in.
*/
virtual bool ProcessElement( const TimeB &RequestTimestamp, void * UserData = nullptr );
};
}} // namesapce MobileRGBD::Kinect1
#endif // KINECT_1
#ifdef KINECT_2
#include "../Kinect/KinectImageConverter.h"
namespace MobileRGBD { namespace Kinect2 {
/**
* @class DrawCameraView DrawCameraView.cpp DrawCameraView.h
* @brief Class to draw video stream from the Kinect2 data.
*
* @author Dominique Vaufreydaz, Grenoble Alpes University, Inria
*/
class DrawCameraView : public DrawRawData
{
public:
/** @brief constructor. Draw data from the video stream of the Kinect2.
*
* @param Folder [in] Main folder containing the data. Body data will be search in 'Folder/video/' subfolder.
* @param SizeOfFrame [in] Size of each frame. Default value = CamWidth*CamHeight*CamBytesPerPixel.
*/
DrawCameraView( const std::string& Folder, int SizeOfFrame = CamWidth*CamHeight*CamBytesPerPixel )
: DrawRawData( Folder + VideoFileName, Folder + RawVideoFileName, SizeOfFrame )
{
StartingFrame = 0;
}
/** @brief Virtual destructor, always.
*/
~DrawCameraView() {};
/** @brief Static function to draw data from RGB raw Kinect buffer.
*
*/
static void Draw( cv::Mat& WhereToDraw, void * FrameBuffer, int ScaleFactor );
/** @brief ProcessElement is a callback function called by mother classes when data are ready.
*
* @param RequestTimestamp [in] The timestamp of the data.
* @param UserData [in] User pointer to working data. Here a pointer to a cv:Mat to draw in.
*/
virtual bool ProcessElement( const TimeB &RequestTimestamp, void * UserData = nullptr );
protected:
static KinectImageConverter ImageConverter; /*!< @brief Converter for the Kinect2 raw YVY2 to BRG */
};
}} // namesapce MobileRGBD::Kinect2
#endif
#endif