Perform OCR with different modes for automatic text area detection

In case you want to perform OCR operation with better mode for automatic text area detection, Aspose.OCR for C++ provides you the following field in RecognitionSetting structure: detect_areas_mode

detect_areas_mode_enum::NONE : Perform OCR operation on an image without automatically detecting the text area. detect_areas_mode_enum::DOCUMENT : Detects paragraphs uses NN model for documents. Better for multicolumn document, document with pictures or with other not text objects. detect_areas_mode_enum::PHOTO : Detects paragraphs uses NN model for photos. Better for image with a lot of pictures and other not text objects. detect_areas_mode_enum::COMBINE : Detects paragraphs with text and then uses other NN model to detect areas inside of paragraphs. Better for images with complex structure.

The following code snippets demonstrate the use of detect_areas_mode field

Perform OCR with different mode for automatic text area detection

	// For complete examples and data files, please go to
	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 };
	/* asposeocr_page_settings*/

	RecognitionSettings settings;
    settings.detect_areas_mode = detect_areas_mode_enum::COMBINE;
    size_t size = asposeocr_page_settings(image.c_str(), buffer, len, settings);
	#ifdef _WIN32
    setmode(_fileno(stdout), 0x00020000);
    setlocale(LC_CTYPE, "");
    std::wcout << buffer;