Background Color Calculation for Noisy Image Binarization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Binarization of digital documents with noisy backgrounds adjacent to text is challenging for optical character recognition (OCR) as it leads to improper conversion, making it difficult to accurately detect edges and recognize text.
Innovation Solution
A method involving edge detection, binarization, dilation, and XOR difference to determine the text boundary, calculating the average grayscale value of pixels covered by the text boundary, and setting background pixels to this value to enhance image quality for OCR, optionally including edge filling and hole filling for improved noise reduction.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If binarization is applied to images with noisy backgrounds, then text edges can be detected, but improper OCR conversion occurs due to noisy background adjacent to text
Solution Approach 1:
The patent segments the image processing into distinct phases: edge detection to identify text boundaries, background color calculation specifically for regions adjacent to text, and selective background replacement. This segmentation allows different processing strategies for text regions versus background regions, resolving the contradiction between edge detection and OCR accuracy.
Solution Approach 2:
The patent applies local quality by calculating and applying background color specifically to regions adjacent to text characters, rather than uniformly processing the entire image. The background color is determined locally around each text region and applied selectively, improving OCR accuracy without affecting edge detection elsewhere in the image.
2Ease of manufacture
If traditional binarization is used, then processing is simple, but noisy background leads to improper OCR conversion
Solution Approach 1:
The patent performs preliminary action by calculating the background color from the original grayscale image before binarization occurs. This pre-calculated background color information is then used to guide the binarization process and subsequent OCR operations, ensuring that noise removal does not compromise text integrity while maintaining processing efficiency.
Solution Approach 2:
The patent introduces an intermediary element - the calculated background color value - that mediates between the noisy original image and the final binarized output. This background color serves as a reference that guides the binarization threshold selection and helps distinguish text from noisy background, improving OCR accuracy without significantly complicating the processing pipeline.
3Reliability
If background pixels are set to calculated average grayscale value, then OCR accuracy improves, but additional processing steps are required
Solution Approach 1:
The patent merges multiple operations into unified processing steps: edge detection and background color calculation are integrated, and background replacement is combined with the binarization process. This merging reduces the overall processing complexity while maintaining the accuracy benefits of the additional steps.
Solution Approach 2:
The patent implements self-service by having the system automatically calculate the background color from the image data itself, rather than requiring manual specification or complex external processing. The background color is derived self-consistently from the statistical properties of pixels adjacent to detected text edges, simplifying the overall process while improving accuracy.
Data Source
AI summary
A method, device and computer readable storage media for enhancing an image for optical character recognition by detecting the edges of the image to create an edge detected image, binarizing the edge detected image to create a binary edge image for processing, dilating the binary edge image to create a dilated binary edge image, taking the XOR difference between the binary edge image and the dilated binary edge image to obtain a text boundary, superimposing the text boundary on the image and determining the pixels of the image that are covered by the text boundary, calculating the average grayscale value of the pixels of the image that are covered by the text boundary, and setting background pixels of the image to the calculated average grayscale value of the pixels of the image that are covered by the text boundary. The method optionally includes the steps of performing edge filling and hole filling on the binary edge image to create an updated binary edge image and filling holes in the dilated binary edge image to create an updated dilated binary edge image, whereby the XOR difference is taken between the updated binary edge image and the updated dilated binary edge image. The image may be binarized for optimal results after the background images have been set to the calculated average grayscale value of the pixels that are covered by the text boundary.


