Browse our Products
Latest release
This article contains a summary of recent changes, enhancements and bug fixes in Aspose.OCR for .NET 24.12.0 (December 2024) release.
GPU version: 23.10.1
Deprecation warning
- The release 24.3.0 updates the codes of some recognition languages to align with ISO 639-2 standard.
- Starting with the release 24.6.0, use
Aspose.OCR.Country.NONE
recognition setting to disable extraction of key details from passport images instead ofAspose.OCR.Country.UNIVERSAL
. - Starting with the release 24.10.0, Aspose.OCR for .NET introduces new content structure detection modes.
To make it easier to upgrade your code, we have kept all legacy values, 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 language codes are scheduled to be removed in release 25.1.0 (January 2025).
Time to deprecation: 1 month left.
What was changed
Key | Summary | Category |
---|---|---|
OCRNET‑958 | Added a container class for storing recognition results. | New feature |
OCRNET‑960 | Added support for recognizing Mongolian texts. | New feature |
OCRNET‑961 | Added a method to release memory by unloading unneeded OCR modules. | New feature |
OCRNET‑814 | Significantly enhanced the performance of saving recognition results to searchable PDFs. | Enhancement |
OCRNET‑946 | Improved the calculation of line height in searchable PDFs. | Enhancement |
Public API changes and backwards compatibility
This section lists all public API changes introduced in Aspose.OCR for .NET 24.12.0 that may affect the code of existing applications.
Added public APIs:
The following public APIs have been added to Aspose.OCR for .NET 24.12.0 release:
Aspose.OCR.OcrOutput
class
A container class that stores recognition results, which is returned from all recognition methods instead of a list of Aspose.OCR.RecognitionResult
objects.
It is fully backward compatible with the List<Aspose.OCR.RecognitionResult>
, which means you do not have to update your existing code.
Aspose.OCR.Resources.ReleaseMemory()
Unload all OCR modules to free up memory. The downloaded module files will remain stored on your system.
If you need to use the OCR module again later, it will automatically reload into memory. Please note that the first recognition attempt may be slightly slower due to the reloading process.
Updated public APIs:
The following public APIs have been updated in Aspose.OCR for .NET 24.12.0 release:
Aspose.OCR.Language
Aspose.OCR for .NET can now extract texts in the following languages:
Value | Alphabet |
---|---|
Aspose.OCR.Language.Mon | Mongolian texts. |
- Mongolian text recognition requires aspose-ocr-cyrillic-v1 OCR feature to be installed.
Aspose.OCR.AsposeOcr.Recognize()
This method now returns an optimized container object, Aspose.OCR.OcrOutput
. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult
objects, so no code updates are necessary at the moment.
Aspose.OCR.AsposeOcr.RecognizeHandwrittenText()
This method now returns an optimized container object, Aspose.OCR.OcrOutput
. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult
objects, so no code updates are necessary at the moment.
Aspose.OCR.AsposeOcr.RecognizeReceipt()
This method now returns an optimized container object, Aspose.OCR.OcrOutput
. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult
objects, so no code updates are necessary at the moment.
Aspose.OCR.AsposeOcr.RecognizeInvoice()
This method now returns an optimized container object, Aspose.OCR.OcrOutput
. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult
objects, so no code updates are necessary at the moment.
Aspose.OCR.AsposeOcr.RecognizeIDCard()
This method now returns an optimized container object, Aspose.OCR.OcrOutput
. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult
objects, so no code updates are necessary at the moment.
Aspose.OCR.AsposeOcr.RecognizeCarPlate()
This method now returns an optimized container object, Aspose.OCR.OcrOutput
. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult
objects, so no code updates are necessary at the moment.
Aspose.OCR.AsposeOcr.RecognizePassport()
This method now returns an optimized container object, Aspose.OCR.OcrOutput
. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult
objects, so no code updates are necessary at the moment.
Aspose.OCR.AsposeOcr.RecognizeLines()
This method now returns an optimized container object, Aspose.OCR.OcrOutput
. The return type is fully compatible with the previously returned list of Aspose.OCR.RecognitionResult
objects, so no code updates are necessary at the moment.
Removed public APIs:
No changes.
Examples
The code samples below illustrate the changes introduced in this release:
Mongolian text recognition
Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
// Add an image to recognition batch
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add("source.png");
// Recognize Mongolian text
Aspose.OCR.RecognitionSettings recognitionSettings = new Aspose.OCR.RecognitionSettings();
recognitionSettings.Language = Aspose.OCR.Language.Mon;
// Extract text from image
Aspose.OCR.OcrOutput results = recognitionEngine.Recognize(input, recognitionSettings);
Console.WriteLine(results[0].RecognitionText);
Unload OCR models from memory
// Download Chinese/English OCR model to "aspose/ocr" directory in the application working directory
Aspose.OCR.Resources.SetLocalPath("aspose/ocr");
Aspose.OCR.Resources.FetchResource("aspose-ocr-chinese-v2");
// Initialize Aspose.OCR for .NET recognition API
Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
// Add images to OcrInput object
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add("source1.png");
input.Add("source2.jpg");
// Set recognition language (Chinese model is loaded to RAM)
Aspose.OCR.RecognitionSettings recognitionSettings = new Aspose.OCR.RecognitionSettings();
recognitionSettings.Language = Aspose.OCR.Language.Chinese;
// Recognize image
Aspose.OCR.OcrOutput results = recognitionEngine.Recognize(input, recognitionSettings);
foreach(Aspose.OCR.RecognitionResult result in results)
{
Console.WriteLine(result.RecognitionText);
}
// Unload all OCR models from memory to free up resources
Aspose.OCR.Resources.ReleaseMemory();