Last active
January 5, 2021 08:52
-
-
Save yektasarioglu/e88478b3c6f1ee0dd3112f69063d6160 to your computer and use it in GitHub Desktop.
This file contains 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
// TextRecognitionViewModel | |
fun analyzeStream() { | |
if (isCameraStarted) | |
textRecognizer.analyzeStream { | |
it.forEach { _, value -> | |
Timber.d("stringValue is ${value?.stringValue}") | |
outputLiveData.postValue(value?.stringValue) | |
value?.contents?.forEachIndexed { index, element -> | |
Timber.d("[$index] is ${element.stringValue}") | |
} | |
} | |
Timber.d("itemList is $it") | |
} | |
} | |
// TextRecognizer | |
fun analyzeStream(onSuccess: (SparseArray<MLText.Block?>) -> Unit) { | |
ocrDetectorProcessor.resultAction = onSuccess | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment