Browse our Products

Aspose.OCR for Python via .NET 23.12.1 - Release Notes

What was changed

KeySummaryCategory
OCRPY‑59Added recognition of handwritten text and introduced Aspose.OCR.Models.Handwritten recognition model.New feature
n/aImproved passport recognition.New feature

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for Python via .NET 23.12.0 that may affect the code of existing applications.

Added public APIs:

The following public APIs have been introduced in Aspose.OCR for Python via .NET 23.12.1 release:

recognize_handwritten_text() method

A specialized recognition method for extracting handwritten text from images. It supports a number of European languages based on Extended Lain alphabet.

recognize_handwritten_text() method has some limitations:

  • The method only supports a limited subset of Extended Latin letters and numbers.
  • Both uppercase and lowercase letters are recognized. However, the resulting text will be in uppercase.
  • This method does not support recognition settings. The recognition language is detected automatically.

PassportRecognitionSettings.country

Enables you to designate a country for retrieving specific passport properties. The value of this recognition setting is provided as Country enumeration.

Country enumeration

A list of countries for retrieving specific passport properties:

ValueCountry
Country.UNIVERSALDo not parse passport details (only extract passport text).
Country.MADAGASCARParse Malagasy passports.

Updated public APIs:

The following public APIs have been changed in Aspose.OCR for Python via .NET 23.12.1 release:

RecognizePassport() method

To use this method, install the Text-in-wild recognition model in your project. If this model is not present, an exception will be thrown.

Removed public APIs:

No changes.

Examples

The code samples below illustrate the changes introduced in this release:

Recognize handwritten memos

import aspose.ocr as ocr
# Initialize an instance of Aspose.OCR
api = ocr.AsposeOcr()
# Add images to recognition batch
input = ocr.OcrInput(ocr.InputType.SINGLE_IMAGE)
input.add("memo.jpg")
# Extract and show handwritten text
res = api.recognize_handwritten_text(input)
print(res[0].recognition_text)

Enable retrieving properties from Malagasy passports

import aspose.ocr as ocr
# Instantiate Aspose.OCR API
api = AsposeOcr()
# Add image to the recognition batch
input = OcrInput(InputType.SINGLE_IMAGE)
input.add("passport1.png")
input.add("passport2.png")
# Enable retrieving properties from Malagasy passports
recognitionSettings = PassportRecognitionSettings()
recognitionSettings.country = ocr.Country.MADAGASCAR
# Recognize passports
results = api.recognize_passport(input, recognitionSettings)
# Print passport texts
for result in results:
    print(result.recognition_text)