Skeleton data can now be seen in the client and in the live window. No skeleton merging/saving yet.

This commit is contained in:
marek
2015-11-05 18:56:53 +01:00
parent 6df7380372
commit 948eee769e
12 changed files with 584 additions and 123 deletions
+9
View File
@@ -15,6 +15,14 @@
#pragma once
#include "utils.h"
#include "Kinect.h"
struct Body
{
bool bTracked;
std::vector<Joint> vJoints;
std::vector<Point2f> vJointsInColorSpace;
};
class ICapture
{
@@ -36,4 +44,5 @@ public:
UINT16 *pDepth;
RGB *pColorRGBX;
std::vector<Body> vBodies;
};
+13 -1
View File
@@ -9,6 +9,7 @@
#pragma once
#include <d2d1.h>
#include "iCapture.h"
class ImageRenderer
{
@@ -41,7 +42,7 @@ public:
/// <param name="pImage">image data in RGBX format</param>
/// <param name="cbImage">size of image data in bytes</param>
/// <returns>indicates success or failure</returns>
HRESULT Draw(BYTE* pImage, unsigned long cbImage);
HRESULT Draw(BYTE* pImage, unsigned long cbImage, std::vector<Body> &bodies);
private:
HWND m_hWnd;
@@ -66,4 +67,15 @@ private:
/// Dispose of Direct2d resources
/// </summary>
void DiscardResources();
void DrawBody(Body &body);
void DrawBone(Body &body, JointType joint0, JointType joint1);
ID2D1SolidColorBrush* m_pBrushJointTracked;
ID2D1SolidColorBrush* m_pBrushJointInferred;
ID2D1SolidColorBrush* m_pBrushBoneTracked;
ID2D1SolidColorBrush* m_pBrushBoneInferred;
ID2D1SolidColorBrush* m_pBrushHandClosed;
ID2D1SolidColorBrush* m_pBrushHandOpen;
ID2D1SolidColorBrush* m_pBrushHandLasso;
};
+4
View File
@@ -35,4 +35,8 @@ private:
ICoordinateMapper* pCoordinateMapper;
IKinectSensor* pKinectSensor;
IMultiSourceFrameReader* pMultiSourceFrameReader;
void GetDepthFrame(IMultiSourceFrame* pMultiFrame);
void GetColorFrame(IMultiSourceFrame* pMultiFrame);
void GetBodyFrame(IMultiSourceFrame* pMultiFrame);
};
+6 -2
View File
@@ -57,6 +57,7 @@ private:
std::vector<Point3f> m_vLastFrameVertices;
std::vector<RGB> m_vLastFrameRGB;
std::vector<Body> m_vLastFrameBody;
std::vector<std::vector<Point3f>> m_vGatheredVertices;
std::vector<std::vector<RGB>> m_vGatheredRGBPoints;
@@ -67,7 +68,8 @@ private:
DWORD m_nFramesSinceUpdate;
Point3f* m_pCameraSpaceCoordinates;
Point2f* m_pColorCoordinates;
Point2f* m_pColorCoordinatesOfDepth;
Point2f* m_pDepthCoordinatesOfColor;
// Direct2D
ImageRenderer* m_pDrawColor;
@@ -81,8 +83,10 @@ private:
bool SetStatusMessage(_In_z_ WCHAR* szMessage, DWORD nShowTimeMsec, bool bForce);
void HandleSocket();
void SendFrame(vector<Point3f> vertices, vector<RGB> RGB, vector<Body> body);
void SocketThreadFunction();
void StoreFrame(Point3f *vertices, Point2f *mapping, RGB *color);
void StoreFrame(Point3f *vertices, Point2f *mapping, RGB *color, vector<Body> &bodies);
void ShowFPS();
void ReadIPFromFile();
void WriteIPToFile();