mlkit icon indicating copy to clipboard operation
mlkit copied to clipboard

ML Kit Text Recognition Fails to Read Single Character Letter "B"?

Open ChefMachine opened this issue 2 years ago • 2 comments

Using ML Kit Vision Quickstart demo code downloaded from GitHub for text recognition of still images. Photos are sample game menus. Text Recognition Latin module fails to recognize the single capital letter "B" as either block, line or element. Screen shots below show recognized text overlaid in black on white.

To Reproduce

  1. Run Vision Quickstart app (either Java or Kotlin version)
  2. Select StillImageActivity button from menu
  3. Select still image from album
  4. Select Text Recognition Latin from Object Detection spinner
  5. Code displays recognized (or not) text lines on original still image using black on white overlays

** Sample emulator screen shots from Quickstart app

Does not recognize line with letter "B"

ML Kit Text Latin Demo6

Correctly identifies all four single character lines A, E, C, D

ML Kit Text Latin Demo5

Does not recognize line with single char "B "

ML Kit Text Latin Demo4

ML Kit Text Latin Demo3 ML Kit Text Latin Demo2 ML Kit Latin Text Demo1

Expected behavior Text Recognition Latin feature should recognize all large block Latin letters from sample game menus. Works OK for several menus, but fails to read standalone capital letter "B" as either block, line or element. Confirmed by inspection of LOGCAT file.

SDK Info: version unclear - here is list of imports from downloaded GitHub code

import com.google.mlkit.vision.text.Text import com.google.mlkit.vision.text.TextRecognition import com.google.mlkit.vision.text.TextRecognizer import com.google.mlkit.vision.text.TextRecognizerOptionsInterface

Smartphone:

  • Device/Simulator: Pixel 4 API 33
  • Emulator sdk_gphone65_arm64 Android v13

Development Environment: Android Studio Dolphin | 2021.3.1 Patch 1 Build #AI-213.7172.25.2113.9123335, built on September 29, 2022 Runtime version: 11.0.13+0-b1751.21-8125866 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

MacBook Pro (14-inch, 2021) macOS 12.6

ChefMachine avatar Dec 04 '22 15:12 ChefMachine

I also had this issue, but with the letters 'Q' and 'O'. These letters are ignored for some reason. I'm guessing the the ML kit is trained for words, not individual letters.

Codestian avatar Jun 29 '24 15:06 Codestian