-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRawKinectRecording.h
executable file
·99 lines (78 loc) · 2.61 KB
/
RawKinectRecording.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
94
95
96
97
98
99
#ifndef __RAW_KINECT_RECORDING_H__
#define __RAW_KINECT_RECORDING_H__
#include "KinectRecording.h"
class RawKinectRecording : public KinectRecording
{
public:
Omiscid::SimpleString FrameType;
// Frame and acquisition process description
int Width;
int Height;
float HorizontalFieldOfView;
float VerticalFieldOfView;
float DiagonalFieldOfView;
int FrameLengthInPixels;
int BytesPerPixel;
virtual void DeclareSerializeMapping()
{
// TODO : change it for skeleton, audio and face for better description
// First local description
AddToSerialization("FrameType", FrameType);
AddToSerialization("Width", Width);
AddToSerialization("Height", Height);
AddToSerialization("HorizontalFieldOfView", HorizontalFieldOfView);
AddToSerialization("VerticalFieldOfView", VerticalFieldOfView);
AddToSerialization("DiagonalFieldOfView", DiagonalFieldOfView);
AddToSerialization("FrameLengthInPixels", FrameLengthInPixels);
AddToSerialization("BytesPerPixel", BytesPerPixel);
// next standard description for KinectRecordings, i.e. FrameRate
KinectRecording::DeclareSerializeMapping();
}
RawKinectRecording()
{
FrameType = Omiscid::SimpleString::EmptyString;
Width = 0;
Height = 0;
HorizontalFieldOfView = 0.0;
VerticalFieldOfView =0.0;
DiagonalFieldOfView = 0.0;
FrameLengthInPixels = 0;
BytesPerPixel = 0;
BufferSize = 0;
FrameRate = 0.0f;
}
void Init(const Omiscid::SimpleString& Prefix, const Omiscid::SimpleString& _FrameType)
{
// Call for raw recording
KinectRecording::Init( Prefix, true );
FrameType = _FrameType;
Width = 0;
Height = 0;
HorizontalFieldOfView = 0.0;
VerticalFieldOfView =0.0;
DiagonalFieldOfView = 0.0;
FrameLengthInPixels = 0;
BytesPerPixel = 0;
BufferSize = 0;
FrameRate = 0.0f;
}
virtual ~RawKinectRecording()
{
}
// Nothing more than in KinectRecording::StartRecording
// virtual bool StartRecording(const char* SessionFolder, double CurrentTime )
// Compute frame rate, save description and call KinectRecording::StopRecording
virtual void StopRecording( double CurrentTime )
{
if ( DescriptionFile != nullptr )
{
// Compute actual frame rate for this recording
FrameRate = (float)InputNumber/(float)(CurrentTime-StartTime);
// Create description, save it and close description file in JSON
Omiscid::SimpleString Description = Omiscid::StructuredMessage(Serialize());
fprintf(DescriptionFile, "%s\n", Description.GetStr());
}
KinectRecording::StopRecording( CurrentTime );
}
};
#endif // __RAW_KINECT_RECORDING_H__