detect_areas_mode_enum::COMBINE

Contents
[ ]

The combination of detect_areas_mode_enum::DOCUMENT and detect_areas_mode_enum::PHOTO, which can extract as much text from an image as possible. The OCR engine detects large blocks of text (such as paragraphs and columns), while the remaining content is analyzed by detect_areas_mode_enum::PHOTO algorithm.

This allows you to handle even the most complex cases like posters, billboards, or random photos. However, it can take a little longer and may be less efficient than the specialized algorithms. Try one of the dedicated area detection methods if you are sure of the content type.

Example

The following code sample demonstrates how to use this document areas detection algorithm:

std::string image_path = "source.png";
const size_t len = 4096;
wchar_t buffer[len] = { 0 };
RecognitionSettings settings;
settings.detect_areas_mode = detect_areas_mode_enum::COMBINE;
size_t res_len = aspose::ocr::page_settings(image_path.c_str(), buffer, len, settings);
std::wcout << buffer;