๐ ML Kit Text Recognition
An extension that enables the use of ML Kit Text Recognition v2 API for offline text recognition.
Extension relies on Google Play Services to download the text recognition modules. Only Latin format is currently being supported by the extension.
๐งฉ
Blocks
- Returns true if Google Play Services are installed, they are required for the extension to work
-
Checks if the text recognition mododules are already installed on the device
- Modules are ready for use, only proceed when called
- Modules are not present on the device and therefore needs to be downloaded
-
Begins downloading text recognition modules
- Download status was updated, possible states:
unknown = 0, pending = 1, downloading = 2, canceled = 3, completed = 4, failed = 5, installing = 6, download_paused = 7
- Module installation was successful, text recognition is ready for use
- Installation was failed, there could be various reasons like Google Play Services or not installed on the device, or there was any interruption
- Takes in the image input from a file path
- Similarly, takes in the image input from Uri object or Uri
- Retrieves the image resource from the Image component
- Text recognition was successful
-
text
is the total combined detected elements -
blocks
is a list of dictionaries, each dictionary contains:-
text
a text block -
lines
a list of lines -
confidences
list of confidence values corresponding to the lines -
angles
list of angles values corresponding to the lines
-
-
There will be more number of parameters added over time
- Get's the image file's EXIF orientation data, could be used with
ProcessFile
Resources
Also see: Input Image Guidelines
TextRecognition.aia (267.2 KB)
xyz.kumaraswamy.textrecognition.aix (265.5 KB)
Extension is specially crafted with optimizations and to reduce redundancy
Thanks,
Kumaraswamy B G
MLKit Text Recognition Implementation ยฉ 2023 by Kumaraswamy B G is licensed under CC BY-ND 4.0