37,720
社区成员
发帖
与我相关
我的任务
分享
for hand in frame.hands:
# handType = "Left hand" if hand.is_left else "Right hand"
print " %s, id %d, position: %s" % (
handType, hand.id, hand.palm_position)
a.append(hand.palm_position[0])
if len(a)>=5:
if a[0]>a[1]>a[2]>a[3]>a[4]:
waveType="Left"
elif a[0]<a[1]<a[2]<a[3]<a[4]:
waveType="Right"
else: a=[]
print waveType
for hand in frame.hands:
print " %s, id %d, position: %s"%(handType, hand.id, hand.palm_position)
waveType = ""
a.append(hand.palm_position[0])
if len(a) == 5:
if a[0] > a[1] > a[2] > a[3] > a[4]:
waveType = "Left"
elif a[0] < a[1] < a[2] < a[3] <a[4]:
waveType="Right"
if not waveType:
a = []
else:
print waveType