Peter aziz
Peter aziz

Reputation: 150

How To Scan a Seven Segment Display by Firebase ML kit Text Recognition?

The Text Recognition API in Firebase Ml kit is not recognizing the digital numbers or a seven segment display numbers that i am trying to scan out from a weight scale , is there anyway to work it out ?

I tried the Dart package for firebase ml vision for flutter apps , and i used the firebaseVisionImage class and Text Recognizer class and visionText class as shown .

 // get image file
final File imageFile = File(widget.imagePath);

// create vision image from that file
final FirebaseVisionImage visionImage =
    FirebaseVisionImage.fromFile(imageFile);

// create detector index
final TextRecognizer textRecognizer =
    FirebaseVision.instance.textRecognizer();

// find text in image
final VisionText visionText =
    await textRecognizer.processImage(visionImage);

I expected to have the numbers as an output but , it's not recognized at all ,

Upvotes: 2

Views: 1269

Answers (2)

Hasan koç
Hasan koç

Reputation: 179

You need to process the image in this type

 final inputImage = InputImage.fromFilePath(imageFile.path);
 final RecognizedText recognizedText = await textRecognizer.processImage(inputImage);

i hope it works :)

Upvotes: -1

Frank van Puffelen
Frank van Puffelen

Reputation: 600120

If the ML Kit model doesn't automatically recognize the text in your image, there isn't a lot you can do to tweak it.

Instead you'll want to:

  • Check if the Cloud Vision model is better able to extract the text from your image.
  • Look into training a custom model for extracting your specific type of text.
  • Look at other dedicated text extraction packages.

Upvotes: 2

Related Questions