processImage method

Future<List<HandMesh>?> processImage(
  1. Uint8List image,
  2. Size imageSize, [
  3. ImageOrientation orientation = ImageOrientation.up
])

Process the image using apple vision and return the requested information or null value

image as Uint8List is the image that needs to be processed this needs to be in an image format raw will not work.

imageSize as Size is the size of the image that is being processed

orientation The orientation of the image

Implementation

Future<List<HandMesh>?> processImage(Uint8List image, Size imageSize,[ImageOrientation orientation = ImageOrientation.up]) async{
  try {
    final data = await _methodChannel.invokeMapMethod<String, dynamic>(
      'process',
      {'image':image,
        'width': imageSize.width,
        'height':imageSize.height,
        'orientation': orientation.name
      },
    );

    return _convertData(data);
  } catch (e) {
    debugPrint('$e');
  }

  return null;
}