c# - Kinect recognises too many swipe right gestures even if I sit still -
this main window:
foreach (joint joint in skeleton.joints) { if (joint.trackingstate != jointtrackingstate.tracked) continue; if ((joint.jointtype == jointtype.handright) || (joint.jointtype == jointtype.handleft)) { swipegesturerecognizer.add(joint.position, kinectsensor, joint.jointtype); } }
and gestures written this:
// swipe right if (scanpositions((p1, p2) => math.abs(p2.y - p1.y) < swipemaximalheight, // height (p1, p2) => p2.x - p1.x > -0.05f, // progression right (p1, p2) => math.abs(p2.x - p1.x) > swipeminimallength, // length swipemininalduration, swipemaximalduration)) // duration { if (jointul == jointtype.handleft) { setclothbygesture(1, 0); raisegesturedetected("swipetoright"); } return; } // swipe left if (scanpositions((p1, p2) => math.abs(p2.y - p1.y) < swipemaximalheight, // height (p1, p2) => p2.x - p1.x < 0.05f, // progression right (p1, p2) => math.abs(p2.x - p1.x) > swipeminimallength, // length swipemininalduration, swipemaximalduration))// duration { if (jointul == jointtype.handright) { setclothbygesture(-1, 0); raisegesturedetected("swipetoleft"); } return; }
my logic if swipe right hand left something, if swipe left hand right else. know doing wrong?
modified code, instead of swipes, if right or left hand farther head 0.45f, command.
c# kinect swipe gestures
No comments:
Post a Comment