Browse our Products
Aspose.OCR for Python via .NET 23.7.1 - Release Notes
What was changed
Key | Summary | Category |
---|---|---|
OCRPY‑34 | Added new recognition settings for automatic handling of white text on a dark/black background. See Added public APIs for important details. | New feature |
Public API changes and backwards compatibility
This section lists all public API changes introduced in Aspose.OCR for Python via .NET 23.7.1 that may affect the code of existing applications.
Added public APIs:
The following public APIs have been introduced in this release:
RecognitionSettings.automatic_color_inversion
When set to true
, Aspose.OCR for Python via .NET uses a special OCR algorithm for automatic detection and accurate recognition of of white text on a dark/black background.
This setting is applicable when using one of the following document area detection modes:
DetectAreasMode.PHOTO
DetectAreasMode.COMBINE
DetectAreasMode.TABLE
DetectAreasMode.CURVED_TEXT
Aspose.OCR.ReceiptRecognitionSettings.automatic_color_inversion
When set to true
, Aspose.OCR for Python via .NET uses a special OCR algorithm for automatic detection and accurate recognition of of white text on a dark/black background in scanned or photographed receipts.
IDCardRecognitionSettings.automatic_color_inversion
When set to true
, Aspose.OCR for Python via .NET uses a special OCR algorithm for automatic detection and accurate recognition of of white text on a dark/black background in scanned or photographed ID cards.
PassportRecognitionSettings.automatic_color_inversion
When set to true
, Aspose.OCR for Python via .NET uses a special OCR algorithm for automatic detection and accurate recognition of of white text on a dark/black background in scanned or photographed passports.
CarPlateRecognitionSettings.automatic_color_inversion
When set to true
, Aspose.OCR for Python via .NET uses a special OCR algorithm for automatic detection and accurate recognition of of white text on a dark/black background in photographed vehicle license plates.
InvoiceRecognitionSettings.automatic_color_inversion
When set to true
, Aspose.OCR for Python via .NET uses a special OCR algorithm for automatic detection and accurate recognition of of white text on a dark/black background in scanned or photographed invoices.
Updated public APIs:
No changes.
Removed public APIs:
No changes.
Examples
The examples below illustrates the changes introduced in this release:
Automatic handling of inverted texts
# Instantiate Aspose.OCR API
api = ocr.AsposeOcr()
# Add an image to the recognition batch
input = ocr.OcrInput(ocr.InputType.SINGLE_IMAGE)
input.add("source.png")
# Apply inverted text detection
settings = ocr.RecognitionSettings()
settings.automatic_color_inversion = False
settings.detect_areas_mode = ocr.DetectAreasMode.TABLE
# Extract text from an image
result = api.recognize(input, settings)
# Print recognition result
print(result[0].recognition_text)