问题
I am currently developing some gesture recognition in C# with Kinect SDK.So far so good, the only problem being that the gesture recognition is instant.
For example: i am using a messageBox to announce when i raise my hand above my head.And if i hold the hand for 2 seconds, it will open dozens of messageBoxes announcing the gesture.
Is there a way to stop this?
回答1:
Darren says the truth. You need to implement a stop mechanism. Kinect is analyzing everything in real time whole time so when your hand is above it is there until it is there :) So every time your action is triggered. Do as Atuls said OR do as I prefer.
I prefere creating a bool flag. Default value is false. When my action is triggered I set it to true and I dont trigger the action again until the flag is false. In your example I would set it to true when I raise my hand above the head and set it to false when I have my hand below my head. That way I
ll trigger the action only once every time i need it
回答2:
I guess you are simply triggering the event if the hand is above your head. This isn't enough.
Just trigger the messagebox once when the gesture is recognised then reset whatever mechanism you have that is checking for the algorithm. You need to restart the gesture checking whenever your hand moves below your head. How you do this depends on how you have implemented the gesture recognition.
回答3:
You can check for MinimumPeriodBetweenGestures as implementated @ Kinect Toolbox. Similarly you can define criterias as per your requirement.
来源:https://stackoverflow.com/questions/10489581/c-sharp-and-kinect-gesture-time