Browse our Products

Aspose.OCR for CPP 22.5 Release Notes

All Features

KeySummaryCategory
OCRCPP-267Integrate the Cyrillic modelEnhancement
OCRCPP-266Fast recognition functionEnhancement

Enhancements

  • added new ML model for Cyrillic alphabets
  • added support for next languages: belorussian, bulgarian, ukrainian, kazakh, russian, serbian
  • added new API function for fast recognition

Public API and Backwards Incompatible Changes

New API

EnumFields
language

bel,
bul,
rus,
srp,
ukr,
kaz

API functionDescription
aspose::ocr::page_fast

in parameters tooks path to the image, buffer for result, size of buffer

Removed APIs

No Changes

Example (C++17 since filesystem)

#include <iostream>
#include <aspose_ocr.h>
#include <filesystem>
#include <corecrt_io.h>
#include <fcntl.h>
int main()
{
_setmode(_fileno(stdout), _O_U16TEXT);
//Current directory const
std::filesystem::path path{ std::filesystem::current_path() };
/* asposeocr_set_license */
const std::string lic = "/Aspose.Total.lic";
std::filesystem::path license = path.string() + lic;
asposeocr_set_license(license.string().c_str());
/* asposeocr_set_license */
bool lic_result = asposeocr_get_state();

//Recognize cyrillic

	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 };

	//Set parameters for recognition
    RecognitionSettings settings;
    settings.language_alphabet = language::rus;

    size_t result = asposeocr_page_settings(image.c_str(), buffer, len, settings);
    std::wcout << buffer;

//Fast recognition (only for latin symbols, without areas detection, without skew correction

    aspose::ocr::page_fast(image.c_str(), buffer, len);
    std::wcout << buffer;
}