1. Overview
The MlTBRek extension for App Inventor 2 and Kodular enables offline text recognition and barcode scanning using ML Kit. This extension offers modules for barcode and text recognition, including support for various scripts such as Latin, Devanagari, Chinese, Japanese, and Korean. Users can initialize text and barcode recognizers, install and check the availability of necessary modules, and recognize text or barcodes from images, file paths, or content URIs. The extension also provides events for handling module states, recognition results, and errors, making it a powerful tool for integrating advanced recognition features into your apps.
Latest Version: 4
Released: 2023-09-02T18:30:00Z
Last Updated: 2024-08-28T18:30:00Z
Aix Size: 1.2mb
2. Blocks
3. Documentation
Events
ModulesInstalled | Event raised when modules have been installedtype | number |
ModulesInstallFailed | Event raised when modules installation failedtype | number errorMsg | text |
ModulesStateUpdated | Event raised when modules state changestype | number state | number progress | number |
GotModulesState | Event raised after checking modules availabilitytype | number areModulesAvailable | boolean |
RecognisedText | Event raised after getting text from imagetext | text blocks | list |
UrlScanned | Event raised if url was found in barcodetitle | text url | text |
ContactInfoScanned | Event raised if contact info was found in barcodeaddress | text email | text name | text orgName | text phone | text title | text urls | text |
EmailScanned | Event raised if email was found in barcodeaddress | text body | text subject | text type | number |
WifiScanned | Event raised if wifi info was found in barcodessid | text pswd | text encryptionType | number |
GeoPointScanned | Event raised if geo points were found in barcodelat | number lon | number |
BarcodeScanned | Event raised when no specific type of barcode was found and given barcode was decoded in generalrawValue | text barFormat | number displayValue | text |
BarRecognitionFailed | Event raised if barcode scanning failederrorMsg | text |
TextRecognitionFailed | Event raised if text recognition failederrorMsg | text |
Methods
BarRecognitionModules | Modules for barcode recognition |
TextRecognitionModules | Modules for text recognitionlangScript | number |
InitTextRecognizer | Initialize Text RecognizerlangScript | number |
InstallModules | Install deps of given typetype | number |
ReleaseModules | Initiates a request to release given modules when they are no longer needed.
This method notifies Google Play services that the modules are no longer needed for this app, but it does not guarantee the modules can be removed. Google Play services will try to clean up the modules when they are not used by any apps.type | number |
CheckModulesAvailability | Checks given modules availabilitytype | number |
RecogniseText | Tries to recognize test from given input that can be an Image component, file path or content uriimage | any |
InitBarRecognizer | Initializes Barcode recognizer/scanner |
RecogniseBarcode | Tries to decode barcode from given input which can be an Image component, file path or content uriimage | any |
Properties
DefaultScript |
Property Type : read-only Accepts : number |
DevanagariScript |
Property Type : read-only Accepts : number |
ChineseScript |
Property Type : read-only Accepts : number |
JapaneseScript |
Property Type : read-only Accepts : number |
KoreanScript |
Property Type : read-only Accepts : number |
4. Usages
Install required modules
Check modules availability
Text Recognisation
First initialize recognizer.
Then provide input image to RecogniseText
block.
RecognisedText
event will be raised with result if recognition was successful otherwise TextRecognitionFailed
event will be raised with error message.
blocks
is a list of dictionaries. Each dictionary contains following keys:
- text : complete text
- lines : a list of lines
- angles : a list of angles corresponding to each line
- confidences : a list of confidence values corresponding to each line
All major language scripts are supported.
- Latin
- Devanagari
- Chinese
- Japanese
- Korean
Barcode Recognition
Initialize Barcode recogniser.
Then provide input image to RecogniseBarcode
block.
Result will be delivered via different events based upon type of barcode.
It can read following barcode formats:
- 1D barcodes: EAN-13, EAN-8, UPC-A, UPC-E, Code-39, Code-93, Code-128, ITF, Codabar
- 2D barcodes: QR Code, Data Matrix, PDF-417, AZTEC
It automatically parses QR Codes, Data Matrix, PDF-417, and Aztec values, for the following supported formats:
- URL
- Contact information (VCARD, etc.)
- WiFi
- Geo-location (latitude and longitude)
more will be added on demand.
5. Demo Video
6. Purchase
Thank you.
Hope it helps!