Skip to content

LightBuzz/Kinect-Drawing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kinect Drawing

A simple drawing app using Kinect, C#, and XAML.

This short demo project will show you the following:

  • How to track a hand using Kinect version 2.
  • How to display the camera stream.
  • How to draw the trail of the hand on top of a XAML canvas.

Video

Watch on YouTube

Tutorial

Read a step-by-step tutorial

Prerequisites

How to run

Simply download the project and hit "Start" using Visual Studio. This project is a showcase demo.

XAML Canvas

	<Image Name="camera" />
	<Canvas Name="canvas">
		<Polyline Name="trail" Stroke="Red" StrokeThickness="15" />
	</Canvas>

Drawing

	Joint handRight = body.Joints[JointType.HandRight];

	if (handRight.TrackingState != TrackingState.NotTracked)
	{
		CameraSpacePoint handRightPosition = handRight.Position;
		ColorSpacePoint handRightPoint = _sensor.CoordinateMapper.MapCameraPointToColorSpace(handRightPosition);

		float x = handRightPoint.X;
		float y = handRightPoint.Y;

		if (!float.IsInfinity(x) && ! float.IsInfinity(y))
		{
			// DRAW!
			trail.Points.Add(new Point { X = x, Y = y });
		}
	}

Contributors

License

You are free to use this source code in personal and commercial projects. Licensed under the MIT License.

About

A simple drawing app using Kinect, C#, and XAML.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages