FaceDetector is built to detect faces in arbitrary bitmaps. Since you are wanting to detect faces in an active camera preview perhaps you might try using the Camera.FaceDetectionListener implementation of face detection as described here:
http://developer.android.com/guide/topics/media/camera.html#face-detection
It is likely that this method of detecting faces is optimized for working in concert with an active camera preview frame.
As well, try opening the stock Android camera app on your device and watch as it detects faces. Does it detect them at the same speed as the face detection in your app? If it's faster, then there's likely something you can do to make your app faster. If not, then your app is likely already as fast as it will get on that device.
For reference, face detection in the stock app on my Nexus 4 averages probably about 0.2s (5 per second) and on my Nexus 10 is a bit slower, probably at about 0.33s (3 per second.)
.
stackoverflow.comm
No comments:
Post a Comment