Browse our Products

Aspose.OCR for Java 23.7.1 - Release Notes

Deprecation warning

What was changed

KeySummaryCategory
OCRJAVA‑251
OCRJAVA‑303
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 Java 23.7.1 that may affect the code of existing applications.

Added public APIs:

The following public APIs have been introduced in Aspose.OCR for Java 23.7.1 release:

RecognitionSettings.setAutomaticColorInversion() method

Set the method parameter to true to enable a special OCR algorithm that automatically detects white text on a dark/black background and applies a special OCR algorithm to improve image recognition accuracy. Call this method with the parameter set to “false” to explicitly disable inverted text detection to save resources.

This setting is applicable when using one of the following document area detection modes:

ReceiptRecognitionSettings.setAutomaticColorInversion() method

Set the method parameter to true to enable a special OCR algorithm that automatically detects white text on a dark/black background and applies a special OCR algorithm to improve receipt recognition accuracy. Call this method with the parameter set to “false” to explicitly disable inverted text detection to save resources.

IDCardRecognitionSettings.setAutomaticColorInversion() method

Set the method parameter to true to enable a special OCR algorithm that automatically detects white text on a dark/black background and applies a special OCR algorithm to improve ID card recognition accuracy. Call this method with the parameter set to “false” to explicitly disable inverted text detection to save resources.

PassportRecognitionSettings.setAutomaticColorInversion() method

Set the method parameter to true to enable a special OCR algorithm that automatically detects white text on a dark/black background and applies a special OCR algorithm to improve passport recognition accuracy. Call this method with the parameter set to “false” to explicitly disable inverted text detection to save resources.

CarPlateRecognitionSettings.setAutomaticColorInversion() method

Set the method parameter to true to enable a special OCR algorithm that automatically detects white text on a dark/black background and applies a special OCR algorithm to improve car license plate recognition accuracy. Call this method with the parameter set to “false” to explicitly disable inverted text detection to save resources.

InvoiceRecognitionSettings.setAutomaticColorInversion() method

Set the method parameter to true to enable a special OCR algorithm that automatically detects white text on a dark/black background and applies a special OCR algorithm to improve invoice recognition accuracy. Call this method with the parameter set to “false” to explicitly disable inverted text detection to save resources.

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

AsposeOCR api = new AsposeOCR();
// Add an image to OcrInput object
OcrInput source = new OcrInput(InputType.SingleImage);
source.add("image.png");
// Apply inverted text detection
RecognitionSettings recognitionSettings = new RecognitionSettings();
recognitionSettings.setAutomaticColorInversion(false);
recognitionSettings.setDetectAreasMode(DetectAreasMode.PHOTO);
// Extract text from images
ArrayList<RecognitionResult> results = api.Recognize(source, recognitionSettings);
// Output result
System.out.println("Recognition result:\n" + results[0].recognitionText + "\n\n");