Browse our Products
Aspose.OCR for Java 23.5.0 - Release Notes
This article contains a summary of recent changes, enhancements and bug fixes in Aspose.OCR for Java 23.5.0 (May 2023) release.
GPU version: 21.6.0
Deprecation warning
The release 23.3.0 introduced a slimmer, faster and more straightforward API. All of your existing code will continue to work and you can even make minor updates to it, but be aware that all deprecated elements are scheduled to be removed in release 23.11.0 (November 2023) in favor of the new API.
Time to deprecation: 4 months left.
Several methods have been revised in release 23.5.0 to align them with the new (23.3.0 and later) API and significantly simplify your code. To make it easier to upgrade your code, we have kept the previous versions of these methods fully functional, but marked them as deprecated.
All of your existing code will continue to work and you can even make minor updates to it, but be aware that all deprecated elements are scheduled to be removed in release 23.11.0 (November 2023) in favor of the new API.
What was changed
Key | Summary | Category |
---|---|---|
OCRJAVA‑320 | Added fast recognition method that works with OcrInput object. | Enhancement |
OCRJAVA‑320 | Specialized recognition methods have been aligned with the new API: RecognizeReceipt , RecognizeInvoice , RecognizeIDCard , RecognizePassport , RecognizeCarPlate . See Updated public APIs for details. | Enhancement |
OCRJAVA‑320 | The existing API methods have been marked as deprecated to remind you to update your existing code. They remain functional but will be removed in release 23.11.0 (November 2023) in favor of the new API introduced in this release. See Deprecated APIs for details. | Enhancement |
Public API changes and backwards compatibility
This section lists all public API changes introduced in Aspose.OCR for .NET 23.5.0 that may affect the code of existing applications.
Added public APIs:
The following public APIs have been introduced in this release:
RecognizeFast(OcrInput input)
method
This method reads a single image in the fastest possible mode and returns a string with extracted text.
This method provides an extended replacement for RecognizePageFast
method.
Updated public APIs:
The following public APIs have been introduced in this release:
RecognizeReceipt(OcrInput input, ReceiptRecognitionSettings settings)
method
This method extracts text from scanned receipts using a specialized AI model. It is an override method that works with the OcrInput
object.
RecognizeInvoice(OcrInput input, InvoiceRecognitionSettings settings)
method
This method extracts text from scanned or photographed invoices using a specialized AI model. It is an override method that works with the OcrInput
object.
RecognizeIDCard(OcrInput input, IDCardRecognitionSettings settings)
method
This method extracts text from scanned or photographed ID cards using a specialized AI model. It is an override method that works with the OcrInput
object.
RecognizePassport(OcrInput input, PassportRecognitionSettings settings)
method
This method extracts text from scanned or photographed passports using a specialized AI model. It is an override method that works with the OcrInput
object.
RecognizeCarPlate(OcrInput input, CarPlateRecognitionSettings settings)
method
This method extracts text from vehicle license plate image using a specialized AI model. It is an override method that works with the OcrInput
object.
Removed public APIs:
No changes.
Deprecated APIs
The following public APIs have been marked as deprecated and will be removed in 23.11.0 (November 2023) release:
RecognizePageFast(String fullPath)
method
Replaced with RecognizeFast(OcrInput input)
method
RecognizeReceipt(String fullPath, ReceiptRecognitionSettings settings)
method
Replaced with RecognizeReceipt(OcrInput input, ReceiptRecognitionSettings settings)
method.
RecognizeReceipt(BufferedImage image_, ReceiptRecognitionSettings settings)
method
Replaced with RecognizeReceipt(OcrInput input, ReceiptRecognitionSettings settings)
method.
RecognizeInvoice(String fullPath, InvoiceRecognitionSettings settings)
method
Replaced with RecognizeInvoice(OcrInput input, InvoiceRecognitionSettings settings)
method.
RecognizeInvoice(BufferedImage image_, InvoiceRecognitionSettings settings)
method
Replaced with RecognizeInvoice(OcrInput input, InvoiceRecognitionSettings settings)
method.
RecognizeIDCard(String fullPath, IDCardRecognitionSettings settings)
method
Replaced with RecognizeIDCard(OcrImage images, IDCardRecognitionSettings settings)
method.
RecognizeIDCard(BufferedImage image_, IDCardRecognitionSettings settings)
method
Replaced with RecognizeIDCard(OcrImage images, IDCardRecognitionSettings settings)
method.
RecognizePassport(String fullPath, PassportRecognitionSettings settings)
method
Replaced with RecognizePassport(OcrImage images, PassportRecognitionSettings settings)
method.
RecognizePassport(BufferedImage image_, PassportRecognitionSettings settings)
method
Replaced with RecognizePassport(OcrImage images, PassportRecognitionSettings settings)
method.
RecognizeCarPlate(String fullPath, CarPlateRecognitionSettings settings)
method
Replaced with RecognizeCarPlate(OcrImage images, CarPlateRecognitionSettings settings)
method.
RecognizeCarPlate(BufferedImage image_, CarPlateRecognitionSettings settings)
method
Replaced with RecognizeCarPlate(OcrImage images, CarPlateRecognitionSettings settings)
method.
Examples
The examples below illustrates the changes introduced in this release:
Fast recognition
AsposeOCR api = new AsposeOCR();
// Add images to the recognition batch
OcrInput images = new OcrInput(InputType.SingleImage);
images.add(os.path.join(self.dataDir, "source1.png"));
images.add(os.path.join(self.dataDir, "source2.png"));
// Fast recognize images
ArrayList<RecognitionResult> results = api.RecognizeFast(images);
results.forEach((result) -> {
System.out.println(result);
});
Vehicle license plate recognition
AsposeOCR api = new AsposeOCR();
// Add images to the recognition batch
OcrInput input = new OcrInput(InputType.SingleImage);
input.add(os.path.join(self.dataDir, "car1.png"));
input.add(os.path.join(self.dataDir, "car2.png"));
// Recognition settings
CarPlateRecognitionSettings recognitionSettings = new CarPlateRecognitionSettings();
recognitionSettings.setIgnoredCharacters("Ää");
// Recognize license plates
ArrayList<RecognitionResult> results = api.RecognizeCarPlate(input, recognitionSettings);
results.forEach((result) -> {
System.out.println(result.recognition_text);
});