Created
May 27, 2020 15:31
-
-
Save giolaq/a8b5de773e0dab45df89c37f8586f915 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class WordSearchAiViewModel( | |
| private val resourceProvider: ResourceProvider, | |
| private val recognizer: DocumentTextRecognizer | |
| ) : ViewModel() { | |
| val resultList: MutableLiveData<List<String>> = MutableLiveData() | |
| val resultBoundingBoxes: MutableLiveData<List<Symbol>> = MutableLiveData() | |
| private lateinit var dictionary: List<String> | |
| fun detectDocumentTextIn(bitmap: Bitmap) { | |
| loadDictionary() | |
| recognizer.processImage(bitmap, { | |
| postWordsFound(it) | |
| postBoundingBoxes(it) | |
| }, | |
| { | |
| Log.e("WordSearchAIViewModel", it) | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment