Android - camera as motion detector

2019-01-31 04:30发布

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.

2条回答
【Aperson】
2楼-- · 2019-01-31 05:00

Here is my open source motion detection app for Android.

https://github.com/phishman3579/android-motion-detection

查看更多
地球回转人心会变
3楼-- · 2019-01-31 05:06

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
查看更多
登录 后发表回答