1

I am trying to do an android app that detects a smile on a face from a camera. Can any one point me how to start? Is there a face detection/recognition library or sdk that is hooked to camera that I can use? Any pointer is appreciated

Thanks a lot

Snake
  • 14,228
  • 27
  • 117
  • 250

3 Answers3

2

For face detection you can use the OpenCV library. For detecting a smile on a face you might have to design your own algorithm.

androidFan
  • 611
  • 2
  • 19
  • 31
  • Thank you. But this is C++ library and they said soon to be available on Android. Hopefully I can see more answers about detecting facial expressions – Snake Jul 20 '12 at 05:54
2

Since Android 4.0 (ICS), the camera API includes support for hardware face detection. However, not all devices can support that, since it relies on having a face detection unit on the device. You have to query the camera parameters to see if face detection is supported on your device.

Alternatively, you can use the effects API added in ICS, which in conjunction with the Google Add-on API supports software face detection. The add-on API contains extra effect definitions, such as face detection. You'll have to install the add-on and look at the documentation to find the information about software face detection, and you'll to set up an OpenGL environment to pass image data to the face detection effect.

Eddy Talvala
  • 17,243
  • 2
  • 42
  • 47
  • I see from your link that there's API support for face detection, but how do you know that it's done in hardware? You mean that there's actually face-detection dedicated silicon in newer Android phones? – Joseph Garvin Jul 22 '12 at 04:40
  • 1
    Technically, the API makes no guarantees about how the face detection is implemented. In practice, at least the Galaxy Nexus does actually have dedicated face detection silicon on its OMAP4 chip (http://lwn.net/Articles/469662/). – Eddy Talvala Jul 26 '12 at 02:11
1

As well as the hardware library introduced in Android 4 there is a software based facedetection library that has been around since android 1. Look at FaceDetector and FaceDetector.Face for more information on them.

This can only detect faces though, I would imagine you would want to detect all the faces in the preview frame and then run a custom smile detection algorithm. You would most likely want to do this in openCV, to do this you can create the openCV methods and import them using android NDK as a native library and call methods on them.

Daniel Jonker
  • 844
  • 10
  • 21