Document areas detection
A scanned image or photograph of a text document may contain a large number of blocks of various content - text paragraphs, tables, illustrations, formulas, and the like. Detecting, ordering, and classifying areas of interest on a page is the cornerstone of successful and accurate OCR. This process is called document areas detection.
Aspose.OCR for Python via .NET offers several document areas detection algorithms, allowing you to choose the one that works best for your specific content.
Area detection modes
You can manually override the default document areas detection method if you are unhappy with the results or get unwanted artifacts.
Document structure analysis algorithm is specified in an optional
detect_areas_mode parameter of recognition settings.
# Instantiate Aspose.OCR API
api = AsposeOcr()
# Add image to the recognition batch
input = OcrInput(InputType.SINGLE_IMAGE)
# Set document areas detection mode
recognitionSettings = RecognitionSettings()
recognitionSettings.detect_areas_mode = DetectAreasMode.DOCUMENT
# Recognize the image
result = api.recognize(input, recognitionSettings)
# Print recognition result
input("Press Enter to continue...")
Aspose.OCR for Python via .NET supports the following document structure analysis methods provided in
|Do not analyze document structure.
|Simple images containing a few lines of text without illustrations or formatting.
Applications requiring maximum recognition speed
|Detect large blocks of text, such as paragraphs and columns. Optimal for multi-column documents with illustrations.
See DetectAreasMode.DOCUMENT for additional details.
|Finds small text blocks inside complex images.
See DetectAreasMode.PHOTO for additional details.
Social security cards
Government and work IDs
|The combination of DetectAreasMode.DOCUMENT and DetectAreasMode.PHOTO.
See DetectAreasMode.COMBINE for additional details.
|Detects cells in tabular structures.
See DetectAreasMode.TABLE for additional details.
|Auto-straightens curved lines and finds text blocks inside the resulting image.
See DetectAreasMode.CURVED_TEXT for additional details.
|Photos of books, magazine articles, and other curved pages.
|Finds individual words on images with sparse text and colored backgrounds.
See DetectAreasMode.TEXT_IN_WILD for additional details.