Skip to content

Other language not working (Recognize text in images with ML Kit #61

@FrancisRR

Description

@FrancisRR

Dear Team,

OCR reader(text recognizer) is working fine in english language but not recognized in tamil language may be some of the other languages also not working.
How to solve this issue. please provide the solution.

My code is:

private fun recognizeText(image: InputImage) {
val recognizer = TextRecognition.getClient()
val identification = LanguageIdentification.getClient()
val result = recognizer.process(image)
.addOnSuccessListener { visionText: Text ->
processTextBlock(visionText)
Log.e(TAG, "Success")
}
.addOnFailureListener { e ->
Log.e(TAG, "${e.message}")
}}

private fun processTextBlock(result: Text) {
    val resultText = result.text
    var lineText: String = ""
    for (block in result.textBlocks) {
        val blockText = block.text
        Log.e("Block text", "$blockText")
        for (line in block.lines) {
            lineText = lineText + "\n" + line.text
            Log.e("Line text", "$lineText")
        }
    }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions