createFromAndroidMediaImage

fun createFromAndroidMediaImage(input: Image, rotation: ImageRotation = ImageRotation.Rotation0, cropRect: Rect = Rect(0, 0, input.width, input.height)): InputImage

Creates an SDK InputImage instance from image obtained from Android Camera API.

Return

an InputImage object created from the provided Image.

Parameters

input

image from Android camera API

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 (as it comes from the camera).