2FAAST Kinect
- Posted: Nov 18, 2011 at 6:00 AM
- 9,353 Views
- 3 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Today's project will interest those looking to emulate other Windows input functions via Kinect by showing how the Kinect can work with the Windows Input Simulator (C# SendInput Wrapper - Simulate Keyboard and Mouse) project.
Keyboard events simulator using angles calculated by using Microsoft Kinect SDK.
Basic Implementation of FAAST http://projects.ict.usc.edu/mxr/faast/ using kinect SDK.
Raise your right hand to the right to press right key , your left hand to the left to the left key. And hand up in the front to press up key.
Edit the code to change the keys or to use another angles to activate key press events.
Project Information URL: http://2faast.codeplex.com/ (and http://inputsimulator.codeplex.com/)
Project Download URL: http://2faast.codeplex.com/releases/view/74966
Project Source URL: http://2faast.codeplex.com/releases/view/74966
Runs with Beta2? Yes. Just remove/re-add the Microsoft.Research.Kinect reference.
void Nui_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
{
canvas.Children.Clear();
humanoid(e);
args_e = e;
foreach (SkeletonData user in e.SkeletonFrame.Skeletons)
{
if (user.TrackingState == SkeletonTrackingState.Tracked)
{
foreach (Joint joint in user.Joints)
{
DrawPoint(joint, Colors.Red);
WriteNames(joint);
}
}
}
}
private void WriteNames(Joint joint)
{
var scaledJoint = ScaleJoint(joint);
Label l = new Label();
l.Margin = new Thickness(scaledJoint.Position.X, scaledJoint.Position.Y, 0, 0);
l.Content = joint.ID.ToString();
canvas.Children.Add(l);
}
private void DrawPoint(Joint joint, Color color)
{
var scaledJoint = ScaleJoint(joint);
Ellipse ellipse = new Ellipse
{
Fill = new SolidColorBrush(color),
Width = 15,
Height = 15,
Opacity = 1,
Margin = new Thickness(scaledJoint.Position.X, scaledJoint.Position.Y, 0, 0)
};
canvas.Children.Add(ellipse);
}
private void sendkeys(double left1,double left2,double right1,double right2)
{
if (left1 >= 30)
{
InputSimulator.SimulateKeyDown(VirtualKeyCode.LEFT);
left.Visibility = Visibility.Visible;
}
else
{
InputSimulator.SimulateKeyUp(VirtualKeyCode.LEFT);
}
if (left2 >= 30)
{
InputSimulator.SimulateKeyDown(VirtualKeyCode.UP);
up.Visibility = Visibility.Visible;
}
else
{
InputSimulator.SimulateKeyUp(VirtualKeyCode.UP);
}
if (right1 >= 30)
{
InputSimulator.SimulateKeyDown(VirtualKeyCode.RIGHT);
right.Visibility = Visibility.Visible;
}
else
{
InputSimulator.SimulateKeyUp(VirtualKeyCode.RIGHT);
}
if (right2 >= 30)
{
InputSimulator.SimulateKeyDown(VirtualKeyCode.UP);
up.Visibility = Visibility.Visible;
}
else
{
InputSimulator.SimulateKeyUp(VirtualKeyCode.UP);
}
}
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
I love the use of the classic theme on Windows for a Kinect post. I guess it could just be a graphics/Windows version limitation on the system but still a nice blend of the old and the new
:) , the reason for using the classic theme is that i have a netbook and its too slow if the use the windows 7 aero theme .
if i* use the windows 7 aero theme
Remove this comment
Remove this thread
close