iOS 中的相机运动感应 [英] Motion Sensing by Camera in iOS

查看:26
本文介绍了iOS 中的相机运动感应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发 iOS 中的一个应用程序,如果相机检测到图像中的某些变化或者我们可以说图像中的运动,它将发生一个事件.这里我不是在问人脸识别或特定的彩色图像运动,当我搜索时,我得到了 OpenCV 的所有结果,而且我还发现我们可以通过使用陀螺仪和加速度计来实现这一点,但是如何呢??

I am working on an app in iOS that will occur an event if camera detects some changes in image or we can say motion in image. Here I am not asking about face recognition or a particular colored image motion, And I got all result for OpenCV when I searched, And I also found that we can achieve this by using gyroscope and accelerometer both , but how??

我是iOS的初学者.所以我的问题是,有没有什么框架或简单的方法可以通过相机检测运动或运动感应.以及如何实现?

I am beginner in iOS.So my question is , Is there any framework or any easy way to detect motion or motion sensing by camera.And How to achieve?

例如,如果我将手移到相机前,它会显示一些消息或警报.

For Example if I move my hand before camera then it will show some message or alert.

请给我一些有用且易于理解的链接.谢谢

And plz give me some useful and easy to understand links about this. Thanx

推荐答案

如果你想要的只是某种粗略的运动检测,我的开源 GPUImage 框架内有一个 GPUImageMotionDetector.

If all you want is some kind of crude motion detection, my open source GPUImage framework has a GPUImageMotionDetector within it.

这个公认的简单运动检测器基于低通滤波器进行逐帧比较,并且可以识别帧之间发生变化的像素数量和变化区域的质心.它适用于实时视频,我知道有些人使用它来激活他们 iOS 应用程序中的功能.

This admittedly simple motion detector does frame-to-frame comparisons, based on a low-pass filter, and can identify the number of pixels that have changed between frames and the centroid of the changed area. It operates on live video and I know some people who've used it for motion activation of functions in their iOS applications.

因为它依赖于像素差异,而不是光流或特征匹配,所以它很容易出现误报,并且无法在离散对象在一帧中移动时对其进行跟踪.但是,如果您只需要基本的运动感应,则很容易将其放入您的应用程序中.查看 FilterShowcase 示例,了解它在实践中的工作原理.

Because it relies on pixel differences and not optical flow or feature matching, it can be prone to false positives and can't track discrete objects as they move in a frame. However, if all you need is basic motion sensing, this is pretty easy to drop into your application. Look at the FilterShowcase example to see how it works in practice.

这篇关于iOS 中的相机运动感应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆