Use FaceCropper to crop faces from a Bitmap or Drawable
masterTo automatically crop faces from an image, instantiate the FaceCropper class and call getCroppedImage(). The getCroppedImage method accepts either a Bitmap object or an int representing a drawable resource ID.
FaceCropper mFaceCropper = new FaceCropper();
// Using a Bitmap
mFaceCropper.getCroppedImage(sourceBitmap);
// Or using a drawable resource ID
mFaceCropper.getCroppedImage(R.drawable.my_image);