0

I have been trying to achieve this for a couple of days now, with more or less no luck.

Requirements: Tablet with Android 5.1 Use Android Face Detection (Camera V2) to constantly search for faces Once a face is found, save the current frame to the file system (optionally already crop the image to the location and size of the face) No visible camera preview

What I already achieved:

1) Using the CameraV2 I found the official FacialTracking example (finds and tracks faces, https://developers.google.com/vision/), but I can't find a way to access the current frame.

2) Using the old Camera API I found this nice app (https://github.com/Macadamian/MonkeyCam) which detects faces and can save the current frame to the filesystem. This solution however has a very high false positive rate for facial detection (this is why I would like to use the new CameraV2 api)

Does anyone have some experience with the CameraV2 api and can give me a hint, in which direction I could go from here?

I would really appreciate it!

Regards, Dustin

Wilt
  • 41,477
  • 12
  • 152
  • 203
user3907491
  • 275
  • 1
  • 3
  • 8

1 Answers1

1

You could try something like what was recommended here:

Mobile Vision API - concatenate new detector object to continue frame processing

You'd change the detect method to do something like this:

public SparseArray<Face> detect(Frame frame) {
  SparseArray<Face> faces = mDelegate.detect(frame);
  if (faces.size() > 0) {
    // save the frame to the file system
  }
  return faces;
}
Community
  • 1
  • 1
pm0733464
  • 2,862
  • 14
  • 16