Skip to content

Commit 6846d3b

Browse files
committed
Updated README.md
1 parent f85d803 commit 6846d3b

File tree

2 files changed

+115
-1
lines changed

2 files changed

+115
-1
lines changed

.gitattributes

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

README.md

+52-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,53 @@
1-
# Kinect-Drawing
1+
# Kinect Drawing
22
A simple drawing app using Kinect, C#, and XAML.
3+
4+
This short demo project will show you the following:
5+
* How to track a hand using Kinect version 2.
6+
* How to display the camera stream.
7+
* How to draw the trail of the hand on top of a XAML canvas.
8+
9+
## Prerequisites
10+
Kinect version 2
11+
* [Kinect for Windows v2 sensor](http://amzn.to/1DQtBSV) or [Kinect for XBOX sensor](http://amzn.to/1AvdswC) with an [adapter](http://amzn.to/1wPJG55)
12+
* [Kinect for Windows SDK v2](http://www.microsoft.com/en-us/download/details.aspx?id=44561)
13+
* Visual Studio 2013 or higher
14+
15+
## How to run
16+
Simply download the project and hit "Start" using Visual Studio. This project is a showcase demo.
17+
18+
## XAML Canvas
19+
20+
<Image Name="camera" />
21+
<Canvas Name="canvas">
22+
<local:DrawingBrush x:Name="brush" Width="300" Height="300" />
23+
<Polyline Name="trail" Stroke="Red" StrokeThickness="15">
24+
<Polyline.Effect>
25+
<BlurEffect Radius="20" />
26+
</Polyline.Effect>
27+
</Polyline>
28+
</Canvas>
29+
30+
## Drawing in C#
31+
32+
Joint handRight = body.Joints[JointType.HandRight];
33+
34+
if (handRight.TrackingState != TrackingState.NotTracked)
35+
{
36+
CameraSpacePoint handRightPosition = handRight.Position;
37+
ColorSpacePoint handRightPoint = _sensor.CoordinateMapper.MapCameraPointToColorSpace(handRightPosition);
38+
39+
float x = handRightPoint.X;
40+
float y = handRightPoint.Y;
41+
42+
if (!float.IsInfinity(x) && ! float.IsInfinity(y))
43+
{
44+
// DRAW!
45+
trail.Points.Add(new Point { X = x, Y = y });
46+
}
47+
}
48+
49+
## Contributors
50+
* [Vangos Pterneas](http://pterneas.com) from [LightBuzz](http://lightbuzz.com)
51+
52+
## License
53+
You are free to use this source code in personal and commercial projects. Licensed under the [MIT License](https://github.com/LightBuzz/Kinect-Drawing/blob/master/LICENSE).

0 commit comments

Comments
 (0)