5

Using a bit of computer vision, I'd like to turn on the display of a wall-mounted Android device when a human walks up to (w/in 2 feet of) the device.

I'm an experienced developer, but I know next to nothing about computer vision. Programmatically turning on the display is easy enough. Any guidance, reading suggestions, tutorials, places to start, etc. would be appreciated.

Edit: To clarify after some comments in the answers -- since this is a permanently-ish wall mount situation, the device will have full-time power. Battery life is a non-issue.

David Pfeffer
  • 38,869
  • 30
  • 127
  • 202

3 Answers3

3

Android has Proximity and Light Sensors, but I don't think those are good enough for your need.

If the display has a front camera, you could probable use OpenCV along with some form of Motion detection to detect when someone approaches close to the screen.

EDIT: Here are the docs for Computer Vision using OpenCV.. http://docs.opencv.org/

Vinay S Shenoy
  • 4,028
  • 3
  • 31
  • 36
3

I think there are three ways of doing this.

  1. Use the camera and face recognition
  2. Use the proximity sensor
  3. Use the microphone for detecting noise
  4. (Use the magnetic sensor and force the user to carry a strong magnet with him)

The problem with the forst one is: Power consumption The problem with the second one is: Very inaccurate sensors and a bad API The problem with the third one is: difficult to recognize the "real" sounds

You can read about the proximity sensor here and of course here.

Andi Krusch
  • 1,383
  • 8
  • 6
1

I'm not really sure, but I would say you can use the light sensor since the light value changes when someone walks close.

public void onSensorChanged(SensorEvent event) {
  if( event.sensor.getType() == Sensor.TYPE_LIGHT) {
    //do something
  }
}
dda
  • 6,030
  • 2
  • 25
  • 34
Droidman
  • 11,485
  • 17
  • 93
  • 141