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

查看:212
本文介绍了在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.

并且plz给我一些有用和容易了解这个链接。
Thanx

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天全站免登陆