Document Image Orientation Detection Using Text-Region Ratios for OCR

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional methods lack the ability to accurately identify and rectify the orientation of document images, leading to reduced accuracy in Optical Character Recognition (OCR) when documents are scanned in rotated orientations.

Innovation Solution

A method and system that utilize a computing device to detect regions in a document image, determine positional information, and analyze the ratio of regions' orientations to rotate the image by 90 or 180 degrees for optimal OCR, using AI-based contour detection and dictionary comparison to identify the correct orientation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If conventional OCR algorithms are used on rotated document images, then text extraction can be performed, but the accuracy of text extraction is reduced

Engineering Contradiction:
ImproveOCR accuracyVSAvoidorientation handling capability
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The system performs preliminary orientation detection and correction before applying OCR algorithms. By analyzing the aspect ratios of detected text regions and determining the dominant orientation, the system rotates the document image to the correct orientation (0°, 90°, 180°, or 270°) before text extraction, ensuring high OCR accuracy regardless of the original scan orientation

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system changes the orientation parameter of the document image based on detected text region characteristics. By calculating the ratio of vertical to horizontal text regions and comparing it against threshold values, the system dynamically adjusts the image rotation angle to optimize text extraction accuracy for different scan orientations

Inventive Principle:
Principle #35Parameter changes

2Adaptability or versatility

If document images are scanned in any orientation, then scanning flexibility is improved, but text recognition accuracy deteriorates when orientation is incorrect

Engineering Contradiction:
Improvescanning orientation flexibilityVSAvoidtext recognition accuracy
Core Design Contradiction:
Adaptability or versatilityVSMeasurement precision

Solution Approach 1:

The system implements a feedback mechanism where OCR results are evaluated and used to verify orientation correctness. If the number of recognized words falls below a threshold or recognition confidence is low, the system infers incorrect orientation and rotates the image accordingly, then re-attempts recognition to ensure accurate text extraction

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system performs preliminary orientation detection by analyzing text region aspect ratios and spatial distributions before OCR processing. This preliminary analysis determines the optimal rotation angle needed to align text horizontally, ensuring that subsequent OCR operations are performed on properly oriented images regardless of scan orientation

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If orientation detection and correction mechanisms are added, then OCR accuracy is improved, but system complexity increases

Engineering Contradiction:
Improvetext extraction accuracyVSAvoidsystem structure complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The system segments the document image into multiple text regions and analyzes the orientation characteristics of each region independently. By detecting contours and calculating aspect ratios for individual text blocks, the system determines the dominant orientation through statistical analysis of region ratios, enabling accurate orientation detection without complex global image analysis

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system uses simple parameter changes based on text region aspect ratios to determine orientation. By calculating the ratio of vertical to horizontal text regions and comparing against predefined thresholds, the system determines the required rotation angle (0°, 90°, 180°, or 270°) using straightforward mathematical operations rather than complex image processing algorithms

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentEP4375956B1Method and system for detecting and correcting orientation of document images
Publication Date: 2025.10.29 L&T TECH SERVICES LTD
  • EP4375956B1 patent drawingFigure 1
  • EP4375956B1 patent drawingFigure 2
  • EP4375956B1 patent drawingFigure 3

AI summary

This disclosure relates to method and system for detecting orientation. The method includes detecting a plurality of regions in a document image, each region including text data, and determining positional information of each of the regions; for each of the plurality of regions, determining a region orientation to be one of first orientation or second orientation based on height and width of the region; determining a ratio of number of regions having first orientation and number of regions having second orientation; determining page orientation of the image as third orientation or second orientation, or rotating the image by 90° in counter-clockwise direction based on the ratio; determining first optical character recognition (OCR) data and second OCR data corresponding to the image and the image rotated by 180°, respectively; and determining number of correct words in first OCR data and second OCR data based on comparison with dictionary data.