Code example for FaceDetector

Methods: findFaces

0
        image = Bitmap.createScaledBitmap(
                image, (int) (width * factor), (int) (height * factor), true);
        mImageSize.set(image.getWidth(), image.getHeight());
 
        if (mFaceDetector == null)
            mFaceDetector = new FaceDetector(image.getWidth(), image.getHeight(), 1);
        int faceCount = mFaceDetector.findFaces(image, mFaces);
        if (faceCount > 0) {
            return mFaces[0];
        } else { 
            return null; 
        } 
    } 
 
    /* 
     * (non-Javadoc) 
     * @see com.cellbots.directcontrol.CameraView.Callback#imageReady(byte[], 
     * int, int, int) 
     */ 
    @Override 
    public void imageReady(byte[] data, int width, int height, int format, boolean reversed) {