Android - 相机作为运动检测器 [英] Android - camera as motion detector
问题描述
如何使用前置摄像头和Android SDK实现简单的运动检测器?
示例场景如下:设备站在支架上,电影。
这是一个教程,介绍如何使用相机拍摄照片。
如果你每秒拍一张照片,然后缩放到8x8像素,你可以很容易地比较两张照片,发现是否发生了什么事情,触发你的行动。
您应该缩小比例的原因如下:
- It is less error prone to noise introduced by the camera
- It will be much faster than doing a comparison of the whole image
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:
这篇关于Android - 相机作为运动检测器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!