File: DepthUtilsImpl.h

package info (click to toggle)
openni2 2.2.0.33%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 22,216 kB
  • sloc: cpp: 111,197; ansic: 35,511; sh: 10,542; python: 1,313; java: 952; makefile: 575; xml: 12
file content (77 lines) | stat: -rw-r--r-- 2,313 bytes parent folder | download | duplicates (4)
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
#ifndef _DEPTH_UTILS_IMPL_H_
#define _DEPTH_UTILS_IMPL_H_

#include <XnLib.h>
#include "DepthUtils.h"

#define MAX_Z 65535

class DepthUtilsImpl
{
public:
	DepthUtilsImpl();
	~DepthUtilsImpl();

	XnStatus Initialize(DepthUtilsSensorCalibrationInfo* pBlob);
	XnStatus Free();

	XnStatus Apply(unsigned short* pOutput);

	XnStatus SetDepthConfiguration(int xres, int yres, OniPixelFormat format, bool isMirrored);

	XnStatus SetColorResolution(int xres, int yres);

	XnStatus TranslateSinglePixel(XnUInt32 x, XnUInt32 y, unsigned short z, XnUInt32& imageX, XnUInt32& imageY);
private:
	void BuildDepthToShiftTable(XnUInt16* pRGBRegDepthToShiftTable, int xres);
	XnStatus BuildRegistrationTable(XnUInt16* pRegTable, RegistrationInfo* pRegInfo, XnUInt16** pDepthToShiftTable, int xres, int yres);

	void CreateDXDYTables (XnDouble* RegXTable, XnDouble* RegYTable,
		XnUInt32 resX, XnUInt32 resY,
		XnInt64 AX6, XnInt64 BX6, XnInt64 CX2, XnInt64 DX2,
		XnUInt32 deltaBetaX,
		XnInt64 AY6, XnInt64 BY6, XnInt64 CY2, XnInt64 DY2,
		XnUInt32 deltaBetaY,
		XnInt64 dX0, XnInt64 dY0,
		XnInt64 dXdX0, XnInt64 dXdY0, XnInt64 dYdX0, XnInt64 dYdY0,
		XnInt64 dXdXdX0, XnInt64 dYdXdX0, XnInt64 dYdXdY0, XnInt64 dXdXdY0,
		XnInt64 dYdYdX0, XnInt64 dYdYdY0,
		XnUInt32 startingBetaX, XnUInt32 startingBetaY);
	void CreateDXDYTablesInternal(XnDouble* RegXTable, XnDouble* RegYTable,
		XnInt32 resX, XnInt32 resY,
		XnInt64 AX6, XnInt64 BX6, XnInt64 CX2, XnInt64 DX2,
		XnInt32 deltaBetaX,
		XnInt64 AY6, XnInt64 BY6, XnInt64 CY2, XnInt64 DY2,
		XnInt32 deltaBetaY,
		XnInt64 dX0, XnInt64 dY0,
		XnInt64 dXdX0, XnInt64 dXdY0, XnInt64 dYdX0, XnInt64 dYdY0,
		XnInt64 dXdXdX0, XnInt64 dYdXdX0, XnInt64 dYdXdY0, XnInt64 dXdXdY0,
		XnInt64 dYdYdX0, XnInt64 dYdYdY0,
		XnInt32 betaX, XnInt32 betaY);

private:
	DepthUtilsSensorCalibrationInfo m_blob;
	XnUInt16* m_pDepthToShiftTable_QQVGA;
	XnUInt16* m_pDepthToShiftTable_QVGA;
	XnUInt16* m_pDepthToShiftTable_VGA;
	XnUInt16* m_pRegistrationTable_QQVGA;
	XnUInt16* m_pRegistrationTable_QVGA;
	XnUInt16* m_pRegistrationTable_VGA;

	PadInfo* m_pPadInfo;
	RegistrationInfo* m_pRegistrationInfo;
	XnUInt16* m_pRegTable;
	XnUInt16* m_pDepth2ShiftTable;

	bool m_bD2SAlloc;
	bool m_bInitialized;
	bool m_isMirrored;
	struct
	{
		int x, y;
	} m_depthResolution, m_colorResolution;

};


#endif