如何使用加速度计进行手势识别

发布于 2024-07-08 07:06:47 字数 279 浏览 12 评论 0原文

我的目标是识别安装在太阳黑子上的加速计的简单手势。 手势可以像旋转设备或以几种不同的动作移动设备一样简单。 该设备目前只有加速度计,但我们正在考虑添加陀螺仪,如果它可以使它更容易/更准确。

有人对如何做到这一点有建议吗? Java 中有可用的库吗? 您推荐我查看的示例项目? 您推荐的论文?

sun Spot 是一个 Java 平台,可帮助您快速制作系统原型。 它使用 Java 进行编程,可以将命令转发回连接到计算机的基站。 如果我需要进一步解释硬件的工作原理,请发表评论。

My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device currently only has accelerometers but we are considering adding gyroscopes if it would make it easier/more accurate.

Does anyone have recommendations for how to do this? Any available libraries in Java? Sample projects you recommend I check out? Papers you recommend?

The sun spot is a Java platform to help you make quick prototypes of systems. It is programmed using Java and can relay commands back to a base station attached to a computer. If I need to explain how the hardware works more leave a comment.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梦途 2024-07-15 07:06:47

加速度计将记录由于重力而产生的恒定加速度,以及设备因用户而受到的任何加速度,以及噪声。

您需要对样本进行低通滤波,以尽可能去除不相关的噪声。 最严重的噪声通常比任何可能的人为加速度的频率更高。

请注意,当用户未加速设备时,唯一的力是重力,因此您可以 推断其在空间中的姿态。 而且,当总加速度与1g相差很大时,一定是由于用户对设备进行了加速; 通过减去最后已知的重力估计,您可以粗略地估计用户加速设备的方向和程度,从而获得可以开始与已知手势列表进行匹配的数据。

使用单个三轴加速度计,您可以检测当前的俯仰和滚动,以及设备的直线加速度。 将加速度减去重力即可得出当前速度的估计值,但由于噪声,该估计值会迅速偏离现实; 您必须在手势之前/之间/期间对用户的行为做出假设,并通过您的 UI 引导他们,以提供设备未加速的点,并且您可以重置估计并可靠地估计重力方向。 再次积分以找到位置不太可能在任何有用的时间长度内提供可用的结果。

如果您有两个相距一定距离的三轴加速度计,或者一个和一些陀螺仪,您还可以检测设备的旋转(通过比较加速度矢量,或直接来自陀螺仪); 在几秒钟内积分角动量将为您提供相对于您开始积分时的当前偏航角的估计,但这又会迅速偏离真实值。

The accelerometers will be registering a constant acceleration due to gravity, plus any acceleration the device is subjected to by the user, plus noise.

You will need to low pass filter the samples to get rid of as much irrelevant noise as you can. The worst of the noise will generally be higher frequency than any possible human-induced acceleration.

Realise that when the device is not being accelerated by the user, the only force is due to gravity, and therefore you can deduce its attitude in space. Moreover, when the total acceleration varies greatly from 1g, it must be due to the user accelerating the device; by subtracting last known estimate of gravity, you can roughly estimate in what direction and by how much the user is accelerating the device, and so obtain data you can begin to match against a list of known gestures.

With a single three-axis accelerometer you can detect the current pitch and roll, and also acceleration of the device in a straight line. Integrating acceleration minus gravity will give you an estimate of current velocity, but the estimate will rapidly drift away from reality due to noise; you will have to make assumptions about the user's behaviour before / between / during gestures, and guide them through your UI, to provide points where the device is not being accelerated and you can reset your estimates and reliably estimate the direction of gravity. Integrating again to find position is unlikely to provide usable results over any useful length of time at all.

If you have two three-axis accelerometers some distance apart, or one and some gyros, you can also detect rotation of the device (by comparing the acceleration vectors, or from the gyros directly); integrating angular momentum over a couple of seconds will give you an estimate of current yaw relative to that when you started integrating, but again this will drift out of true rapidly.

坏尐絯 2024-07-15 07:06:47

由于似乎没有人按照 OP 的要求提到现有的库,因此:

http://www.wiigee.org/

wiigee 旨在与 Wiimote 一起使用,是一种基于开源 Java 的实现,用于基于加速度计读数的模式匹配。 它使用隐马尔可夫模型[1]来实现这一点。

显然,Thorn Technologies 公司使用它取得了巨大的效果,他们在这里提到了他们的经验:http://www.thorntech.com/2013/07/mobile-device-3d-accelerometer-based-gesture-recognition/

或者,您可以考虑 FastDTW (https://code.google.com /p/fastdtw/)。 它的准确性不如常规的DTW[2],但计算成本也较低,这对于嵌入式系统或移动设备来说是一个大问题。

[1] https://en.wikipedia.org/wiki/Hidden_​​Markov_model

[2] https://en.wikipedia.org/wiki/Dynamic_time_warping

编辑:OP 在其中一条评论中提到,他使用 1 美元识别器。 他还提到轮换并不是他的项目的标准。

Since no one seems to have mentioned existing libraries, as requested by OP, here goes:

http://www.wiigee.org/

Meant for use with the Wiimote, wiigee is an open-source Java based implementation for pattern matching based on accelerometer readings. It accomplishes this using Hidden Markov Models[1].

It was apparently used to great effect by a company, Thorn Technologies, and they've mentioned their experience here : http://www.thorntech.com/2013/07/mobile-device-3d-accelerometer-based-gesture-recognition/

Alternatively, you could consider FastDTW (https://code.google.com/p/fastdtw/). It's less accurate than regular DTW[2], but also computationally less expensive, which is a big deal when it comes to embedded systems or mobile devices.

[1] https://en.wikipedia.org/wiki/Hidden_Markov_model

[2] https://en.wikipedia.org/wiki/Dynamic_time_warping

EDIT: The OP has mentioned in one of the comments that he completed his project, with 90% accuracy in the field and a sub-millisecond compute time, using a variant of $1 Recognizer. He also mentions that rotation was not a criteria in his project.

铜锣湾横着走 2024-07-15 07:06:47

尚未提及的是实际的手势识别。 这是最难的部分。 清理数据(低通滤波、标准化等)后,您仍然有大部分工作要做。

看看隐马尔可夫模型。 这似乎是最流行的方法,但使用它们并不简单。 通常有一个预处理步骤。 首先进行 STFT 并将所得向量聚类到字典中,然后将其输入 HMM。 看看谷歌代码中的 jahmm 的 java 库。

What hasn't been mentioned yet is the actual gesture recognition. This is the hard part. After you have cleaned up your data (low pass filtered, normalized, etc) you still have most of the work to do.

Have a look at Hidden Markov Models. This seems to be the most popular approach, but using them isn't trivial. There is usually a preprocessing step. First doing STFT and clustering the resultant vector into a dictionary, then feeding that into a HMM. Have a look at jahmm in google code for a java lib.

仅此而已 2024-07-15 07:06:47

添加到 Moonshadow 关于必须重置重力和旋转基线的观点...

除非设备预计具有稳定的静止时刻(作用在其上的唯一力是重力)来重置其测量基线,否则您的系统最终将发展相当于眩晕。

Adding to moonshadow's point about having to reset your baseline for gravity and rotation...

Unless the device is expected to have stable moments of rest (where the only force acting on it is gravity) to reset its measurement baseline, your system will eventually develop an equivalent of vertigo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文