Browse our Products

Aspose.OCR for Python via C++ 24.3.0 - Release Notes

What was changed

KeySummaryCategory
OCRCPP‑575Receipt recognition.New feature
OCRCPP‑575Vehicle registration plate recognition.New feature
OCRCPP‑574Automatic detection of image areas where text recognition may be inaccurate or where information may be lost.New feature
OCRCPP‑579Logging recognition events to a console or saving them to a file.New feature
OCRCPP‑584Multithreading support.New feature

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for Python via C++ 24.3.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 C++ 24.3.0 release:

AsposeOCRRecognizeVehicleLicensePlate()

Extracts text from a vehicle license plate image. This method also allows you to customize recognition accuracy and other settings.

AsposeOCRRecognizeReceipt()

Extracts text from scanned or photographed receipts. This method also allows you to customize recognition accuracy and other settings.

DefectType enumeration

Automatically find potentially problematic areas of image during recognition. In order to enable this functionality, specify the type of image defects to be detected in defects property of recognition settings.

The following types of defects can be found:

DefectEnumeration valueDescriptionImpact
Salt-and-pepper noiseDefectType.SALT_PEPPER_NOISEAppears as random white and black pixels scattered across the area. Often occurs in digital photographs.
  • Some characters are misidentified
  • Unnecessary dots or commas appear in recognition results
Low contrast between text and backgroundDefectType.DARK_IMAGESHighlights and shadows typically appear on curved pages.
  • Low recognition accuracy
  • Text not recognized (ignored by OCR engine)
Curved textDefectType.CURVED_TEXTCylindrical curvature of the page that often appear when photographing pages of books and magazine articles.
  • Some characters are misidentified
  • Text not recognized
BlurDefectType.BLURED_IMAGEThe entire image or some of its areas are out of focus.
Important: This detection algorithm can only identify the entire image as blurry. Specific areas cannot be detected.
  • Characters are not recognized correctly
  • Text not recognized (ignored by OCR engine)
GlareDefectType.GLAREHighlight areas in an image caused by uneven lighting, such as spot lights or flash.
  • Low recognition accuracy
  • Text not recognized (ignored by OCR engine)
Thick textDefectType.EXTRA_BOLD_TEXTExtra-bold text.
  • Some characters are misidentified

To detect multiple defects, combine them through the OR bitwise operator:

import asposeocr

settings = asposeocr.RecognitionSettings()
settings.defects = asposeocr.DefectType.SALT_PEPPER_NOISE | asposeocr.DefectType.DARK_IMAGES

AsposeOCRLogSettings object

Allows you to configure the global logging parameters:

PropertyDescription
console_output_enabledSet to true to enable the display of recognition progress in the console.
logging_levelSpecify the log severity. See the description of LogLevel enumeration for details.
output_pathSpecify an absolute or relative path to the log file.

LogLevel enumeration

The log severity used as a value of logging_level property:

ValueDescription
ERRORError events of considerable importance that will affect normal program execution.
WARNINGPotentially harmful situations that might still allow the application to continue running. The log will also include errors (as if ERROR is also specified).
TRACEDetailed trace messages useful for application developers. The log will also include errors and warnings (as if ERROR and WARNING are specified).

AsposeOCRSetAllowedThreadNumber()

Specifies the number of threads used by the recognition engine. By default, recognition is performed on the application’s main thread.

AsposeOCRGetAllowedThreadNumber()

Return the number of threads used by the recognition engine.

Updated public APIs:

No changes.

Removed public APIs:

No changes.

Examples

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

Recognize vehicle license place

import asposeocr

''' add image to the recognition batch '''
images = [asposeocr.AsposeOCRInput()]
images[0].url = 'photo.png'

''' recognize the image '''
settings = asposeocr.RecognitionSettings()
recognition_result = asposeocr.AsposeOCRRecognizeVehicleLicensePlate(images, settings)
recognition_text = asposeocr.AsposeOCRSerializeResult(recognition_result, asposeocr.ExportFormat.text)
print(result[0].recognition_text)

Detect low contrast an noisy areas

import asposeocr

''' add image to the recognition batch '''
images = [asposeocr.AsposeOCRInput()]
images[0].url = 'image.png'

''' detect image defects and recognize the image '''
settings = asposeocr.RecognitionSettings()
settings.defects = asposeocr.DefectType.SALT_PEPPER_NOISE | asposeocr.DefectType.DARK_IMAGES
recognition_result = asposeocr.AsposeOCRRecognizeVehicleLicensePlate(images, settings)

Log errors and warnings to console

import asposeocr

log_settings = asposeocr.AsposeOCRLogSettings()
log_settings.logging_level = asposeocr.LogLevel.WARNING

Run recognition on 8 threads

import asposeocr

asposeocr.AsposeOCRSetAllowedThreadNumber(8)