Recognition

Contents
[ ]

Reading text from any content in Aspose.OCR for Python via .NET is as easy as calling a universal recognize() method.

This method takes OcrInput object and optional recognition settings.

Recognition results are returned as a list of RecognitionResult objects, that allow you to perform advanced manipulations with recognition results, including automatic spelling correction and saving results in various formats.

Example

The following code example shows how to extract text from multiple images:

# Instantiate Aspose.OCR API
api = AsposeOcr()
# Add image to the recognition batch
input = OcrInput(InputType.SINGLE_IMAGE)
input.add("source1.png")
input.add("source2.png")
# Set recognition language
recognitionSettings = RecognitionSettings()
recognitionSettings.language = Language.UKR;
# Recognize the image
results = api.recognize(input, recognitionSettings)
# Print recognition result
for result in results:
    print(result.recognition_text)