【发布时间】:2014-04-13 15:12:27
【问题描述】:
有谁知道如何通过手部跟踪计算手势速度? (我正在使用 simpleopenNI 0.27 处理 1.5.1)
感谢您的关注
【问题讨论】:
标签: image-processing processing kinect motion-detection simple-openni
有谁知道如何通过手部跟踪计算手势速度? (我正在使用 simpleopenNI 0.27 处理 1.5.1)
感谢您的关注
【问题讨论】:
标签: image-processing processing kinect motion-detection simple-openni
速度是每单位时间的距离。因此,速度为:
distance_between_hand_in_consecutive_frames/(seconds_per_frame)
要在 3d 中查找距离,请在连续帧中使用 Euclidean distance 和手的位置。
编辑:一个伪代码示例。
f1 = get_current_frame_hand_coordinates()
f0 = get_previous_frame_hand_coordinates()
然后你需要一个函数来计算距离。你的输入应该是两个元组,这里是 a 和 b,大小为 3,即 (x,y,z)
e_distance(a,b):
d = square_root( (a[0]-b[0])^2 + (a[1]-b[1])^2 + (a[2]-b[2])^2 )
return d
dist = e_distance(f0,f1)
基本上,您只需将元组值插入等式即可。我不确定你的代码是如何布局的,这是为一组 single 元组设计的。
既然你有了距离,那么我们只需要计算速度。
speed = distance/seconds_per_frame
Wikipedia says Kinect 的帧速率在 9 到 30 Hz 之间。这意味着您的 seconds_per_frame 在 1/9 到 1/30 秒之间。
这只会给你速度。您的问题询问的是速度(只有幅度),但您也可以通过一点触发相当容易地获得速度(既有幅度也有方向)。
【讨论】: