When using ML Kit, the process required to get results is usually the following:
- You get an image.
- You send it to the API to get some information about the image.
- The ML Kit API returns data to the app, which can then use it as necessary.
The first step is getting an instance of the Firebase ML Vision API. In this recipe, we got it with the following instruction:
final FirebaseVision vision = FirebaseVision.instance;
The next step is creating a FirebaseVisionImage, which is the image object used for the API detector. In our example, you created it with the following instruction:
final FirebaseVisionImage visionImage = FirebaseVisionImage.fromFile(image);
Once the FirebaseVision instance is available and FirebaseImageVision is available, you call a detector; in this case, you called a TextRecognizer detector with the following instruction:
TextRecognizer recognizer = vision.textRecognizer()...