Programming a Kinect Bounding Box
- Posted: Sep 02, 2011 at 6:00 AM
- 7,392 Views
- 1 Comment
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
Getting the Kinect to respond to some people, in a specific area, but not others... a Bounding Box. Mike Hodnick, not only shows us how, but provides a great 16 minute tutorial screencast to talk us through it too.
In my last post and screen cast I showed how to implement the Kinect runtime as part of a Model-View-ViewModel (MVVM) pattern. In this post and accompanying screen cast I will build on that application by adding a "bounding box" feature that limits control of the application depending on where the user is standing.
Imagine a scenario where your Kinect-based application is running in an area where there is a lot of "noisy" user traffic in the background. It could be in a lobby, a trade show booth, a career fair, or a point of sale counter to name just a few scenarios. You obviously don't want users in the background to control your application. You only want users who want to control your application to actually control it.
There is more than one way to solve this problem. Perhaps the easiest way is to limit where a user is allowed to stand in order to control and interact with the application. I call this method The Bounding Box method. This method works great if you have multiple instances of the application running side by side and if you don't want one instance to allow control by the user of the second instance.
Project Information URL: http://kindohm.com/2011/08/02/KinectBoundingBox.html
Project Source URL: https://github.com/kindohm/kinect-bounding-box
double minDistanceFromCamera;
public double MinDistanceFromCamera
{
get { return this.minDistanceFromCamera; }
set
{
this.minDistanceFromCamera = value;
this.OnPropertyChanged("MinDistanceFromCamera");
}
}
double boundsWidth;
public double BoundsWidth
{
get { return this.boundsWidth; }
set
{
this.boundsWidth = value;
this.OnPropertyChanged("BoundsWidth");
}
}
double boundsDepth;
public double BoundsDepth
{
get { return this.boundsDepth; }
set
{
this.boundsDepth = value;
this.OnPropertyChanged("BoundsDepth");
}
}
bool userIsInRange;
public bool UserIsInRange
{
get { return this.userIsInRange; }
set
{
this.userIsInRange = value;
this.OnPropertyChanged("UserIsInRange");
}
}
bool GetUserIsInRange(
Microsoft.Research.Kinect.Nui.Vector torsoPosition)
{
return torsoPosition.Z > this.MinDistanceFromCamera &
torsoPosition.Z < (this.MinDistanceFromCamera + this.BoundsDepth)
& torsoPosition.X > -this.BoundsWidth / 2 &
torsoPosition.X < this.BoundsWidth / 2;
}
Contact Information:
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?
The bounding box is such a cool idea. Being able to use Kinect in crowded areas, which will limit control of the application, makes it seem a lot more appealing. How do you determine the necessary area requirements for the bounding box? http://bit.ly/nlBTmF
Remove this comment
Remove this thread
close