DetectAreasMode.COMBINE

Contents
[ ]

The combination of DetectAreasMode.DOCUMENT and DetectAreasMode.PHOTO, which can extract as much text from an image as possible. The Aspose.OCR for Python via .NET engine detects large blocks of text (such as paragraphs and columns), while the remaining content is analyzed by DetectAreasMode.PHOTO algorithm.

This allows you to handle even the most complex cases like posters, billboards, or random photos. However, it can take a little longer and may be less efficient than the specialized algorithms. Try one of the dedicated area detection methods if you are sure of the content type.

Example

The following code sample demonstrates how to use this document areas detection algorithm:

# Instantiate Aspose.OCR API
api = AsposeOcr()
# Add image to the recognition batch
input = OcrInput(InputType.SINGLE_IMAGE)
input.add("source.png")
# Set document areas detection mode
recognitionSettings = RecognitionSettings()
recognitionSettings.detect_areas_mode = DetectAreasMode.COMBINE
# Recognize the image
result = api.recognize(input, recognitionSettings)
# Print recognition result
print(result[0].recognition_text)
input("Press Enter to continue...")