detect method

  1. @override
void detect(
  1. DetectableImage image,
  2. bool streamed
)
override

Implementation

@override
void detect(DetectableImage image, bool streamed) async
{
  if (!busy)
  {
    busy = true;

    count++;
    Payload? payload = await ITextDetector().detect(image);
    if (payload != null)
    {
      Data data = Payload.toData(payload);
      await onDetected(data);
    }
    else if (!streamed) {
      await onDetectionFailed(Data(data: [{"message" : "Text detector $id failed to detect any text in the supplied image"}]));
    }

    busy = false;
  }
}