createFromBitmap

fun createFromBitmap(input: Bitmap, rotation: ImageRotation, cropRect: Rect): InputImage

Creates SDK input image from Android Bitmap.

Parameters

input

Bitmap image.

rotation

rotation needed to transform the image to the correct orientation.

cropRect

crop rectangle associated with this frame. The crop rectangle specifies the region of valid pixels in the image (e.g. pixels visible in camera preview). Crop rectangle does not take into account image orientation, it should be set for raw image.