Unable to detect faces in image from camera
<p>I am unable to take a picture with the camera and have it detect any faces. I display the picture on the screen and can clearly see my face on the image, but it is never detected. My logcat prints "No face found!"</p>

<pre><code>public void takePictureNoPreview(Context context) {
    camera = openFrontFacingCamera();
    if (camera != null) {
        try {
            SurfaceTexture dummy = new SurfaceTexture(0);
            camera.setPreviewTexture(dummy);
            camera.startPreview();

            camera.takePicture(null, null, this);

        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
        }

    } else {
        // booo, failed!
    }
}

@Override
public void onPictureTaken(byte[] data, Camera camera) {
    Log.i(LOG_TAG, "Picture taken");
    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inPreferredConfig = Bitmap.Config.RGB_565;
    Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length, options);
    FaceDetector faceDetector = new FaceDetector(bitmap.getWidth(),
            bitmap.getHeight(), 1);
    Face[] faces = new Face[1];
    int foundFaces = faceDetector.findFaces(bitmap, faces);
    if (foundFaces &gt; 0) {
        Log.i(LOG_TAG, "Found a face!");
    } else {
        Log.i(LOG_TAG, "No face found!");
    }
    camera.release();
    sendImageToActivity(bitmap);
}
</code></pre>
