FrameConversion extension

Extension to help with frame conversion for ML Kit.

ML Kit expects specific image formats:

  • Android: NV21 or YV12
  • iOS: BGRA8888
on

Methods

toBinaryMask({double threshold = 0.5}) Uint8List

Available on Uint8List, provided by the FrameConversion extension

Create a simple binary mask from confidence values.
toNV21(int width, int height) Uint8List

Available on Uint8List, provided by the FrameConversion extension

Convert RGBA to NV21 format for Android ML Kit.