Browse our Products

Aspose.OCR for C++ 23.10.0 - Release Notes

Deprecation warning

What was changed

KeySummaryCategory
OCRCPP‑516Automatically detects blurry images that may not be accurately recognized.New feature
OCRCPP‑516Automatic detection of curved lines that may require extra preprocessing and custom recognition settings.New feature

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been introduced in this release:

defect_type.ASPOSE_OCR_CURVED_TEXT enumeration

Enables automatic detection of image areas containing cylindrical curvature distortions, which may negatively affect recognition accuracy or even result some texts not to be recognized.

defect_type.ASPOSE_OCR_BLURED_IMAGE enumeration

Allows you to automatically detect blurry images, the recognition accuracy of which may be insufficient without preprocessing.

AsposeOCRDefectType.ASPOSE_OCR_CURVED_TEXT enumeration

Marks image areas with curved text detected with defect_type.ASPOSE_OCR_CURVED_TEXT algorithm.

AsposeOCRDefectType.ASPOSE_OCR_BLURED_IMAGE enumeration

Marks the blurry image identified with defect_type.ASPOSE_OCR_BLURED_IMAGE algorithm. Note, that the entire image area is returned as the detection result.

Updated public APIs:

No changes.

Removed public APIs:

No changes.

Usage examples

The examples below illustrates the changes introduced in this release:

Detecting curved image areas

int main()
{
	// Provide the image  for recognition
	string file = "source.png";
	AsposeOCRInput source;
	source.url = file.c_str();
	vector<AsposeOCRInput> content = {source};
	// Enable detection of curved areas
	RecognitionSettings settings;
	settings.defect_type = defect_type::ASPOSE_OCR_CURVED_TEXT;
	// Extract text from the image
	AsposeOCRRecognitionResult result = asposeocr_recognize(content.data(), content.size(), settings);
	// Show low-contrast areas
	print(result);
	// Release the resources
	asposeocr_free_result(result);
}

std::ostream& operator<<(std::ostream& op, const rect& input)
{
	op << "top: " << input.y << "; left: " << input.x << "; width: " << input.width << "; height:" << input.height;
	return op;
}

void print(const AsposeOCRRecognitionResult& input)
{
	for (size_t p_number = 0; p_number < input.pages_amount; ++p_number)
	{
		cout << "Page " << p_number << ";\n";
		const auto& page = input.recognized_pages[p_number];
		for (size_t defect_number = 0; defect_number < page.defects_count; ++defect_number)
		{
			const auto& defect_area = page.defect_areas[defect_number];
			cout << "Curved text areas " << defect_number << ":" << defect_area.area << std::endl;
		}
	}
}