0

I want to develop an app where the face is detected using the front camera. However the image is not taken. The front camera should only detect the face and check whether it is within the correct dimensions. These dimensions will then help me to detect the distance between the face and front camera. I also want to check whether the phone is held at a distance of 20 inches or about 1 feet or not. If this is possible.. please help me with it. The app is basically for testing vision. I want to add the above feature in it.

Amy
  • 1
  • 1
    As per my knowledge it is not possible in Android till now. Only Face Detection facility is available. Face Recognization, etc. facilities are not available in Android. – Anil Jadhav Jul 08 '14 at 05:28
  • You can use the opencv for android library for detecting faces and getting the coordinates etc. – Shivam Verma Jul 08 '14 at 05:34

1 Answers1

0

You can achieve this without Unity or OpenCV or any other library. Please refer this and this links. They detect faces with help of android.hardware.Camera.Face class. Alo you will need to implement the listener android.hardware.Camera.FaceDetectionListener to grab the event of face detection. On being detected, you will get the face[] that will give you all the information related to the face that was detected. Hope this in what you wanted.

Name is Nilay
  • 2,743
  • 4
  • 35
  • 77
  • I have seen the above links but it shows me errors related to the R variable. Please help. – Amy Jul 10 '14 at 07:09
  • http://stackoverflow.com/questions/24670305/face-detection-error-in-code?noredirect=1#comment38247416_24670305 – Amy Jul 10 '14 at 07:10
  • I fixed the errors . However the app is not working on the device. I am using Google nexus 5. It tells that The app cannot be installed. I have given the permissions for camera in the manifest file. What else could be the error.?? – Amy Jul 14 '14 at 07:27