Document Image Orientation Detection Using Text-Region Ratios for OCR
Find Innovative SolutionsGenerate 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
Engineering 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
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
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
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
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
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
3Measurement precision
If orientation detection and correction mechanisms are added, then OCR accuracy is improved, but system complexity increases
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
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
Data Source
Figure 1
Figure 2
Figure 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.