Browse our Products

Aspose.OCR for C++ 24.4.0 - Release Notes

What was changed

KeySummaryCategory
OCRCPP‑597Advanced OCR features are now selectively downloaded as needed.New feature

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for C++ 24.4.0 that may affect the code of existing applications.

Added public APIs:

The major change introduced in Aspose.OCR for C++ 24.4.0 is that the distributive now offers basic recognition capabilities only. Additional features can be added via downloadable resources, freely available in our online repository.

This approach allows you to selectively choose which features you need for your project, keeping your codebase lean and modular.

AsposeOCRResourceLoadSettings structure

Allows you to configure resource loading settings:

MemberTypeDescription
resources_root_pathchar*Absolute or relative path to the directory in which the downloadable OCR resources are located. If automatic resource loading is enabled, the files will be downloaded to this directory.
Do not forget to include a directory with downloaded resources in your distributive, otherwise the related functionality will fail.
lazy_loadboolAutomatically load the required resources when calling the method dependent on them. Requires Internet connection at the runtime.
Disabled by default.

asposeocr_set_resource_load_settings()

Apply the resource loading settings configured in AsposeOCRResourceLoadSettings structure.

Updated public APIs:

No changes.

Removed public APIs:

No changes.

Examples

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

Cyrillic characters recognition

AsposeOCRResourceLoadSettings load_settings;
std::string root_path = "models";
load_settings.resource_root_path = root_path.c_str();
asposeocr_set_resource_load_settings(load_settings);
// Set recognition language
RecognitionSettings settings;
settings.language_alphabet = language::eng;
// Provide the image  for recognition
string file = "source.png";
AsposeOCRInput source;
source.url = file.c_str();
vector<AsposeOCRInput> content = {source};
// Extract text from the image
AsposeOCRRecognitionResult result = asposeocr_recognize(content.data(), content.size(), settings);

Automatically download resources

AsposeOCRResourceLoadSettings load_settings;
std::string root_path = "models";
load_settings.resource_root_path = root_path.c_str();
load_settings.lazy_load = true;
asposeocr_set_resource_load_settings(load_settings);
// Set recognition language
RecognitionSettings settings;
settings.language_alphabet = language::eng;
// Provide the image  for recognition
string file = "source.png";
AsposeOCRInput source;
source.url = file.c_str();
vector<AsposeOCRInput> content = {source};
// Extract text from the image
AsposeOCRRecognitionResult result = asposeocr_recognize(content.data(), content.size(), settings);