Android - 相机作为运动检测器 [英] Android - camera as motion detector

查看:267
本文介绍了Android - 相机作为运动检测器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用前置摄像头和Android SDK实现简单的运动检测器?



示例场景如下:设备站在支架上,电影。

解决方案

这是一个教程,介绍如何使用相机拍摄照片。



如果你每秒拍一张照片,然后缩放到8x8像素,你可以很容易地比较两张照片,发现是否发生了什么事情,触发你的行动。



您应该缩小比例的原因如下:





  1. How to implement a simple motion detector using the front camera and Android SDK?

    An example scenario would be like this: a device is standing on a stand and plays a movie. If a person appears in front of it, without even touching it - it changes the movie.

    解决方案

    Here is a Tutorial on how to take a photo with the camera.

    If your take a photo every second, and then scale it down to something like 8x8 pixels, you can easily compare two photos and find out if something has happened, to trigger you action.

    The reason why you should scale it down are the following:

    1. It is less error prone to noise introduced by the camera
    2. It will be much faster than doing a comparison of the whole image

    这篇关于Android - 相机作为运动检测器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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