Click here to Skip to main content
15,883,910 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I am writing an application such that when the kinect sensor sense any skeleton the application should be ready to use.
If skeleton moves away from the view of sensor the application should be stopped for particular time.if it detects any skeleton the application will start from the first programmatically.
Like If sensor detects any skeleton the background color has to be changed if user is not in its view it should i.e color should be there for particular time after wards it should be back to the original background color

Thanks in advance
Posted
Comments
SASS_Shooter 23-May-12 11:34am    
Just what is your question?

1 solution

LOL, your question is all over the place
What do you mean by "application will start from the first programmatically"?
What do you mean by "the application should be stopped"?

But it sounds like you want to track state of your app.
You can start with an enum (States) with 2 states, Active and Inactive and have
A variable that holds the state (CurrentState)
A int to hold the count of frames since its been inactive (CurrentInactiveFrameCount)
A int to the maximum Inactive Frame Count (CurrentInactiveFrameCountMax)
, in your FrameReady event code, if there are any skeletons picked up change the CurrentState to States.Active else CurrentState to States.Inactive.

Below is basic pseudocode code

if(CurrentState is States.Active)
{
  Process skeleton data as per normal 
}
else
{
if(CurrentInactiveFrameCount < CurrentInactiveFrameCountMax)
{
  if(CurrentInactiveFrameCount=0) //only change colour the first time
    background colour = Brushes.SomeColour
  CurrentInactiveFrameCount++

}
else
  background colour = Brushes.OriginalColour
}


Just remember that the default is 30fps at 640x480, so your CurrentInactiveFrameCountMax would be ROUGHLY 150 if you want the background colour to change for about 5 seconds
So neither your program nor the Kinect stop, it just changes state, and so changes behaviour.


If yous still not with me, then I can write a proper program that does all this when I get back home in a few days
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900