getFaceCutFromContext function Null safety
- dynamic faceCut
Cuts out the face from raw image imgBytes
Implementation
Future<imglib.Image> getFaceCutFromContext(Context faceCut) async {
Uint8List _bytes = faceCut["blob"].getBytes();
final height = faceCut["shape"][0].get_value();
final width = faceCut["shape"][1].get_value();
final img = imglib.Image.fromBytes(width: width, height: height,
bytes: _bytes.buffer, order: imglib.ChannelOrder.rgb);
return img;
}