Browse our Products

Aspose.OCR for C++ 22.6 Release Notes (June 2022)

What was changed

KeySummaryCategory
OCRCPP-274Added a new detection mode for better identification and recognition of tabular structures.New feature
OCRCPP-275
OCRCPP-277
Added a new machine learning model for image denoising:
  • Integrated Binarized Neural Network (BNN) and related tests.
  • Implemented pre- and post-processing algorithms for Binarized Neural Network.
Enhancement
OCRCPP-278Recognition results can now be saved in JSON format.New feature

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been introduced in this release:

detect_areas_mode_enum::TABLE

A new recognition setting that enables automatic detection of table cells.

export_format::json

A new recognition setting that forces recognition results to be returned in JSON format.

RecognitionSettings.auto_denoising

A new recognition setting for enabling or disabling automatic noise removal from recognized images.

Updated public APIs:

No changes.

Removed public APIs:

No changes.

Usage examples

The example below (C++ 17) illustrates the changes introduced in this release:

#include <iostream>
#include <aspose_ocr.h>
#include <filesystem>
#include <corecrt_io.h>
#include <fcntl.h>

int main()
{
    _setmode(_fileno(stdout), _O_U16TEXT);

    // Current directory
    std::filesystem::path path{ std::filesystem::current_path() };

    // Licensing
    const std::string lic = "/Aspose.Total.lic";
    std::filesystem::path license = path.string() + lic;
    asposeocr_set_license(license.string().c_str());
    bool lic_result = asposeocr_get_state();

    /** Save recognition results to JSON */
    RecognitionSettings settings;
    set.save_format = file_format::format_json;
    asposeocr_page_save("img1.jpg;img2.jpg", "result.json", set);

    /** Get recognition results in JSON format */
    // Prepare buffer for result (in symbols, len_byte = len * sizeof(wchar_t))
    const size_t len = 4096;
    wchar_t buffer[len] = { 0 };	
    RecognitionSettings settings;
    set.format = export_format::json;
    size_t result = asposeocr_page_settings(image.c_str(), buffer, len, settings);
    std::wcout << buffer;	

    /** Image pre-processing with noise removal */
    const string image = "img.jpg";
    // Prepare buffer for result (in symbols, len_byte = len * sizeof(wchar_t))
    const size_t len = 4096;
    wchar_t buffer[len] = { 0 };
    RecognitionSettings settings;
    set.auto_denoising = true;
    size_t result = asposeocr_page_settings(image.c_str(), buffer, len, settings);
    std::wcout << buffer;	
}