|
|
@ -15,6 +15,7 @@ namespace KinectConnection
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private BodyFrameReader reader;
|
|
|
|
private BodyFrameReader reader;
|
|
|
|
private Body[] bodies = null;
|
|
|
|
private Body[] bodies = null;
|
|
|
|
|
|
|
|
private Canvas drawingCanvas = null;
|
|
|
|
|
|
|
|
|
|
|
|
public Body[] Bodies
|
|
|
|
public Body[] Bodies
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -24,6 +25,8 @@ namespace KinectConnection
|
|
|
|
|
|
|
|
|
|
|
|
public Dictionary<JointType, Point> JointPoints { get; private set; }
|
|
|
|
public Dictionary<JointType, Point> JointPoints { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BodyImageStream() : base()
|
|
|
|
public BodyImageStream() : base()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Initialize the bodies array
|
|
|
|
// Initialize the bodies array
|
|
|
@ -70,9 +73,9 @@ namespace KinectConnection
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (JointType jointType in body.Joints.Keys)
|
|
|
|
foreach (JointType jointType in body.Joints.Keys)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// 3D space point
|
|
|
|
// 3D
|
|
|
|
CameraSpacePoint cameraSpacePoint = body.Joints[jointType].Position;
|
|
|
|
CameraSpacePoint cameraSpacePoint = body.Joints[jointType].Position;
|
|
|
|
// 2D space point
|
|
|
|
// 2D
|
|
|
|
ColorSpacePoint colorSpacePoint = this.KinectSensor.CoordinateMapper.MapCameraPointToColorSpace(cameraSpacePoint);
|
|
|
|
ColorSpacePoint colorSpacePoint = this.KinectSensor.CoordinateMapper.MapCameraPointToColorSpace(cameraSpacePoint);
|
|
|
|
|
|
|
|
|
|
|
|
JointPoints[jointType] = new Point(colorSpacePoint.X, colorSpacePoint.Y);
|
|
|
|
JointPoints[jointType] = new Point(colorSpacePoint.X, colorSpacePoint.Y);
|
|
|
|