Alma
Alma

Reputation: 95

Text Orientation analysis before running Text Recognition API

For OCR project, I am trying to use MLKit Text Recognition API. No text extracted when image is rotated, only when it is in the up-right position. Modifying the sample provided here https://github.com/googlesamples/mlkit/blob/master/android/vision-quickstart/app/src/main/java/com/google/mlkit/vision/demo/kotlin/VisionProcessorBase.kt

When requesting detection, I am using this if that matters

InputImage.fromByteArray(frame.imageBytes, frame.imageSize.width, frame.imageSize.height, frame.rotationDegrees, frame.imageFormat) 

Any insight how to force the TextProcessor to use the image text orientation.

Upvotes: 2

Views: 507

Answers (1)

Lekster
Lekster

Reputation: 41

Have you considered using Google Vision API? It is able to extract text even in inverted position.

I find it odd that both MLKit and Google Vision are from the same parent company yet have different performance.

enter image description here

Upvotes: 0

Related Questions