这是行人在拥挤中移动的轨迹
正如你所看到的,他/她的头在做一个类似摆动的动作。所以不是一个完美的窦性曲线,也不是一条直线。在
有没有可能为这种不规则曲线定义一个“振幅”和一个“频率”?在
更新:
到目前为止,我尝试了两种不同的方法:
- 第一种方法是在计算拐点的基础上,用它们制作样条曲线。在
- 第二种方法基于unutbu的建议,并使用了Ramer-Douglas-Peucker算法。在
结果如下:
我在RDP中看到的问题是自由参数dist
。低值(意味着更多细节)意味着产生的轨迹发生振荡。所以我不得不小心这个参数。此外,splin
ed曲线更加平滑。在
你觉得怎么样?在
Tags:
做这件事没有绝对正确的方法。下面只是一种方法。在
让我们从假设/声称人们通常倾向于走直线开始。所以你可以用Ramer-Douglas-Peucker algorithm用一小段线段来估计人的预期路径。(有一个Python implementation of the algorithm here。)
然后生成distances of the true data points from the line segments。在
这个距离数组是一个时间序列。然后你可以用时间序列的root-mean-squared作为振幅的度量,然后用Fourier transform来找到它的主频(或频率)。在
以下是对您链接到的RDP模块的更新,该模块应该使用向量与Python 3.x一起使用:
与原始模块给出的演示类似,下面是一个使用场景示例:
^{pr2}$相关问题 更多 >
编程相关推荐