The Idea: TV Screen in the Reception, When nothing happens (no one is in the reception) we can display videos on the screen but when someone enters the frame, show him the Kinect Image, and if the user is doing something funny, capture his image and save it.
The question is how can I know if the person is doing something funny?
For that, I've created Image AuthenticManager that contains a set of rules defining what positions or combinations are funny.
For example: If right hand position is higher than head position, then add 2 points, if the left foot position is crossing the right foot, then add an additional 2 points, etc.
When the user reaches the goal, we decide then to take his picture.
Before jumping to coding, let's talk about the application flow:
The main window is controlled by two Timers and the AuthenticManager:
SeriousTimer set to 10 secs and it starts Ticking as the Kinect Skeleton Event is first fired (this event will only work when the Kinect identifies a full person skeleton).
Inside the SkeletonFrameReady, we also have integer called _fpsCount that increases itself by 1 each time the SkeletonFrameReady is called after starting the SeriousTimer, this will help us to make sure the user is standing in front of the Kinect and not just walk by him.
Now how can the _fbsCount tell me that? ll we need to do is multiply the SeriousTimer seconds interval by the Minimum Fps (for example 10) and the _fpsCount should be bigger if the user stands in front of the Kinect.
In this case, the Timer will stop the Video feed and will display the Kinect Image.
IdleTimer by default is set to 30 seconds and each time the SkeletonFrameReady method is fired, we restart the IdleTimer.
So if there are no events for SkeletonFrameReady, the IdleTimer will return the Video feed.
JointID - AuthenticManager works with RuleObject that contains JointID Source and JointID Target (More about Joints - Kinect - Getting Started - Become The Incredible Hulk).
AuthenticManager is the heart of Kinect Reception application, this class will check if the user position is funny by your own rules.
What is Joint?
The data is provided from the Kinect application code as a set of points, called skeleton positions, that compose a skeleton structure.
public enum JointID
HipCenter = ,
Spine = 1,
ShoulderCenter = 2,
Head = 3,
ShoulderLeft = 4,
ElbowLeft = 5,
WristLeft = 6,
HandLeft = 7,
ShoulderRight = 8,
ElbowRight = 9,
WristRight = 10,
HandRight = 11,
HipLeft = 12,
KneeLeft = 13,
AnkleLeft = 14,
FootLeft = 15,
HipRight = 16,
KneeRight = 17,
AnkleRight = 18,
FootRight = 19,
Count = 20,
- Vector - For Source and Target Joints, you also have to define the Vector to check X or Y against one another.
- Operator - Do you expect the Source Vector to be Bigger or Smaller than the Target Vector?
- Score - If the rule is true, what is the score for the rule.
Since Microsoft has released the Kinect.NET SDK, I wrote many articles on that subject:
I think Kinect is very cool and I'm searching for more projects and good ideas for Kinect. A couple of days ago, I talked with my friend Guy Burstein and he came up with an idea for Kinect application, he said what if people will enter the Microsoft Israel reception and instead of video screen showing commercials, let's add something interesting with Kinect.
Using the Code
Using Kinect events, I can see when user enters the frame, using two timers I can check if the user is just passing by or is standing in front of the camera.
The below image describes the application flow, at the beginning the application will show random videos, when the Kinect Skeleton Event will raise then the Serious Timer will begin ticking, each tick based on the FPS rate will be aggregated to variable called NumTicks, when the Serious Timer completes we check if NumTicks is big enough based on the FPS, if so then we'll start the Idle Timer and switch to Kinect Image.
Idle Timer - Each time the Kinect Skeleton Event is raised, the Idle Timer will be restart, so if there is no one in front of the Kinect camera, the Idle Timer will switch back to Videos.
As you can see from the images below (or