firebasecameraface-recognitionface-detectionfirebase-mlkit

How to avoid Blur image capture in firebase ML Kit’s Face Detection API


I am using firebase ML Kit’s Face Detection API. And I am using it for detecting a face using front camera of device as shown in the image. align your face with the outline

So, whenever any face comes into the face overlay it captures an image on successful face detection. On successful face detection I then send the captured image to My own API for further processing. But sometimes it captures a blur images which I don’t want. For that purpose, I need to capture best 3 images on successful face detection. So how can I achieve that?


Solution

  • Which camera API you are using? If you are using camera2 API, CameraCaptureSession.CaptureCallback returns focus and the exposure state through CaptureResult