The ML Kit Digital Ink Recognition API offers the capability to identify handwritten text, classify gestures on a digital surface, and recognize sketches. This technology, which is employed in Gboard, Google Translate, and the Quick, Draw! game, supports hundreds of languages.
Key features of digital ink recognition include:
Allowing users to write on the screen instead of using a virtual keyboard, enabling the input of characters not readily available on their keyboard (e.g., ệ, अ, or 森 for Latin alphabet keyboards).
Recognizing hand-drawn shapes and emojis (via Auto Draw Model).
This API operates based on the strokes drawn by the user on the screen. Digital ink recognition functions entirely offline and is compatible with both Android and iOS platforms.
Import VoxelBusters.EasyMLKit and VoxelBusters.CoreLibrary namespaces
For using Digital Ink feature, you need to first check if the model that is internally used is available or not. If it's not available, it needs to be downloaded. The model handling is handled by an utility class called DigitalInkRecognizerModelManager
// Get Model Manager from DigitalInkRecognizer instance// recognizerInstance = new DigitalInkRecognizer(); // ...privateDigitalInkRecognizerModelManagerGetModelManager(){DigitalInkRecognizerModelManager modelManager =recognizerInstance.GetModelManager();return modelManager;}
Each model is referred with an identifier. So first create the model identifier
Once a required model is available, you can call Prepare. For preparing, you need to pass on an Drawing Input Source on which you add the strokes and DigitalInkRecognizerOptions. A callback is triggered when prepare is complete.