How to Handle Vertical Japanese Text in Android OCR

Published: (February 20, 2026 at 09:40 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

The Problem

Most OCR engines are optimized for horizontal left‑to‑right text. When you feed them a manga page with vertical Japanese text, you get:

  • Garbled character order
  • Merged text from adjacent columns
  • Missing characters at column boundaries
  • Completely wrong reading direction

Detection Strategies

Aspect Ratio Analysis

Vertical text blocks tend to be taller than wide. If a detected text region has a height‑to‑width ratio > 2:1, it’s likely vertical text.

Character Spacing Patterns

In vertical text, characters are stacked with consistent vertical spacing. Analyze the spatial distribution of detected characters — if they cluster along vertical axes, rotate the region 90° before OCR.

ML Kit’s Built‑in Support

Google’s ML Kit (used in many Android OCR apps) has improved vertical text support in recent versions. The TextRecognition API with the Japanese script recognizer handles vertical text reasonably well out of the box.

Practical Solution: Screen Translator’s Approach

In Screen Translator, we handle vertical Japanese text with a multi‑step pipeline:

  1. Capture – MediaProjection API captures the screen
  2. Pre‑process – Detect text regions and analyze orientation
  3. Rotate if needed – Vertical regions get rotated 90° CW
  4. OCR – Run text recognition on normalized images
  5. Post‑process – Reorder characters to correct reading order
  6. Translate – Send properly ordered text to translation API

Tips for Developers

  • Always test with real manga pages, not just synthetic test images.
  • Japanese text in games often uses custom fonts that reduce OCR accuracy.
  • Furigana (small reading aids above kanji) can confuse OCR — consider filtering by text size.
  • Mixed horizontal/vertical layouts (common in manga) need per‑region orientation detection.

Results

With proper vertical text handling, OCR accuracy on manga pages jumps from ~40 % to ~85 %+ for clean digital scans. The key insight is that text orientation detection must happen before OCR, not after.

Screen Translator is a free floating overlay translator for Android that handles vertical Japanese text, manga, games, and more: Google Play

0 views
Back to Blog

Related posts

Read more »