Browse our Products

Latest release

What was changed

KeySummaryCategory
#OCRNET‑1272Added public region type metadata for recognized text lines and detected recognition regions.New feature

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been introduced in this release:

Aspose.OCR.RecognitionResult.LinesResult.RegionType - a new property

Returns the detected layout region type and the bounds of the region that contains the recognized text line.

New Property

PropertyTypeDescription
RegionTypeKeyValuePair<RegionTypes, Aspose.Drawing.Rectangle>The key contains the detected region type. The value contains the bounding rectangle of the detected region.

Aspose.OCR.RecognitionResult.RegionResult.RegionType - a new property

Returns the detected layout type for a recognized region.

New Property

PropertyTypeDescription
RegionTypeRegionTypesDetected type of the recognition region.

Updated public APIs:

No signature changes.

Table recognition has been improved to address a customer-reported issue.

Removed public APIs:

No changes.

Examples

The code sample below illustrates the changes introduced in this release:

Read region types from recognition results

using Aspose.OCR;
using System;

AsposeOcr recognitionEngine = new AsposeOcr();

OcrInput input = new OcrInput(InputType.SingleImage);
input.Add("document.png");

RecognitionSettings settings = new RecognitionSettings
{
    DetectAreasMode = DetectAreasMode.MULTICOLUMN
};

RecognitionResult result = recognitionEngine.Recognize(input, settings)[0];

foreach (RecognitionResult.RegionResult region in result.RecognitionRegionsResult)
{
    Console.WriteLine($"Region type: {region.RegionType}");
    Console.WriteLine(region.TextInRegion);
}

foreach (RecognitionResult.LinesResult line in result.RecognitionLinesResult)
{
    Console.WriteLine($"Line region type: {line.RegionType.Key}");
    Console.WriteLine($"Region bounds: {line.RegionType.Value}");
    Console.WriteLine(line.TextInLine);
}