Recognizing text from an image
We’ll start with ML by incorporating ML Kit’s text recognizer. You will create a feature where you take a picture, and if there is some recognizable text in it, ML Kit will turn it into one or more strings.
Getting ready
For this recipe, you should have completed the previous one: Using the device camera.
How to do it...
In this recipe, after taking a picture, you will add a text recognition feature. Follow these steps:
- Import the latest version of the
google_mlkit_commons
andgoogle_mlkit_text_recognition
packages in yourpubspec.yaml
file by typing in your Terminal:flutter pub add google_mlkit_commons flutter pub add google_mlkit_text_recognition
- Create a new file in the
lib
folder of your project and call itml.dart
. - Inside the new file, import the
dart:io
andgoogle_mlkit_text_recognition
packages:import 'dart:io'; import ' package:google_mlkit_text_recognition...