mirror of
https://github.com/storytold/LiveScan3D.git
synced 2026-10-09 00:09:58 +00:00
Skeleton data can now be seen in the client and in the live window. No skeleton merging/saving yet.
This commit is contained in:
@@ -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;
|
||||
};
|
||||
@@ -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;
|
||||
};
|
||||
@@ -35,4 +35,8 @@ private:
|
||||
ICoordinateMapper* pCoordinateMapper;
|
||||
IKinectSensor* pKinectSensor;
|
||||
IMultiSourceFrameReader* pMultiSourceFrameReader;
|
||||
|
||||
void GetDepthFrame(IMultiSourceFrame* pMultiFrame);
|
||||
void GetColorFrame(IMultiSourceFrame* pMultiFrame);
|
||||
void GetBodyFrame(IMultiSourceFrame* pMultiFrame);
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user