Implementation
InputImage getInputImage() {
final InputImageRotation imageRotation =
InputImageRotationMethods.fromRawValue(
cameraDescription.sensorOrientation) ??
InputImageRotation.Rotation_0deg;
final InputImageFormat inputImageFormat =
InputImageFormatMethods.fromRawValue(
int.parse(cameraImage.format.raw.toString()),
)!;
final List<InputImagePlaneMetadata> planeData = getPlaneMetaData();
final InputImageData inputImageData = InputImageData(
size: getSize(),
imageRotation: imageRotation,
inputImageFormat: inputImageFormat,
planeData: planeData,
);
return InputImage.fromBytes(
bytes: getBytes(),
inputImageData: inputImageData,
);
}