detectBuffer method
Document edge detection
bytes
- bytes of the image.
width
- width of the image.
height
- height of the image.
stride
- stride of the image.
format
- format of the image.
Returns a List of DocumentResult.
Implementation
Future<List<DocumentResult>> detectBuffer(Uint8List bytes, int width,
int height, int stride, int format, int rotation) async {
if (_cvr != null) {
final dsImage = jsify({
'bytes': bytes,
'width': width,
'height': height,
'stride': stride,
'format': format,
'orientation': rotation
});
DetectedResult detectedResult = await handleThenable(
_cvr!.capture(dsImage, 'DetectDocumentBoundaries_Default'))
as DetectedResult;
return _createContourList(detectedResult.items);
}
return [];
}