Thursday 8 August 2013

Android FaceDetection and frame data pairing

Android FaceDetection and frame data pairing

Currently I am creating an android app that wants to pick out faces from a
camera feed, in which I can do more analyzing later.
At the moment, I have instantiated a camera object, on which I have called
.setPreviewCallback() and .setFaceDetectionListener(), and have overridden
the corresponding methods accordingly.
What I am wondering is when onFaceDetection() is called, I want to get the
frame data that it detected the face on. At the moment my work around is
to pair it with onPreviewFrame(byte[] data, Camera camera), in which I set
some boolean in onFaceDetection() that causes the byte[] data from
onPreviewFrame to be saved. However, I am unsure of whether
onPreviewFrame() or onFaceDetection() is called first.
So I guess in essence, my question is: 1. What is called first...
onPreviewFrame() or onFaceDetection()? OR 2. How would I go about getting
the frame data that onFaceDetection() corresponds to?

No comments:

Post a Comment