recognize method
Future<List<OcrResult> >
recognize(
- Object handle,
- Uint8List imageBytes, {
- int maxSideLen = 960,
- bool runDetection = true,
- bool runClassification = false,
- bool runRecognition = true,
override
Runs OCR on an image encoded in a browser/native-decodable format.
Implementation
@override
Future<List<OcrResult>> recognize(
Object handle,
Uint8List imageBytes, {
int maxSideLen = 960,
bool runDetection = true,
bool runClassification = false,
bool runRecognition = true,
}) async {
final raw = await methodChannel.invokeListMethod<dynamic>(_Channel.recognize, {
_Channel.instanceId: handle as int,
_Channel.imageBytes: imageBytes,
_Channel.maxSideLen: maxSideLen,
_Channel.runDetection: runDetection,
_Channel.runClassification: runClassification,
_Channel.runRecognition: runRecognition,
});
return (raw ?? const [])
.cast<Map<dynamic, dynamic>>()
.map(OcrResult.fromMap)
.toList(growable: false);
}