I am trying to develop a simple app using camera preview overlayed by another custom view. My aim is to get the frame data from Camera.PreviewCallback.onPreviewFrame(byte[] data, Camera camera)
, convert it to Bitmap and call FaceDetector.findFaces(Bitmap bitmap, Face[] faces)
. I need to detect faces and draw boxes on the detected faces on the overlayed custom view.
I am looking out for a faster way to convert the jpg encoded byte array to Bitmap image. My ImageFormat for camera is JPEG, that I came to know using Camera.Paramaeters.getPictureFormat ()
. I am expecting the conversion to happen fast otherwise I will have to drop frames for processing to avoid crash.
I did some search to find Getting frames from Video Image in Android to tackle YUV formats, but could not find anything for jpg encoded array to be converted to bitmap.