getFaceEmbeddingFromMatBytes method
Generates a face embedding from raw pixel bytes without constructing a cv.Mat.
Mirrors detectFacesFromMatBytes - use this when you already have decoded pixel data to avoid the overhead of building a Mat on the calling thread.
Parameters:
bytes: Raw pixel data (e.g. BGR, BGRA)width: Image width in pixelsheight: Image height in pixelsmatType: OpenCV MatType value (default: CV_8UC3 = 16 for BGR)
Implementation
Future<Float32List> getFaceEmbeddingFromMatBytes(
Face face,
Uint8List bytes, {
required int width,
required int height,
int matType = 16,
}) async {
_requireReady();
final Object? result = await _sendDetectionRequest<Object?>(
'embeddingMat',
{
'bytes': TransferableTypedData.fromList([bytes]),
'width': width,
'height': height,
'matType': matType,
'eyes': _embeddingEyesPayload(face),
},
);
return result as Float32List;
}