Table of Contents

Constructor OcrResult

Namespace
LMKit.Extraction.Ocr
Assembly
LM-Kit.NET.dll

OcrResult(IEnumerable<TextElement>, double, double, int, double)

Initializes a new instance of the OcrResult class with a collection of layout-aware text elements, page dimensions, rotation, and skew information.

[JsonConstructor]
public OcrResult(IEnumerable<TextElement> textElements, double pageWidth, double pageHeight, int pageRotation = 0, double pageSkew = 0)

Parameters

textElements IEnumerable<TextElement>

The layout-aware text elements to associate with the OCR result.

pageWidth double

The width of the source page or image in points or pixels.

pageHeight double

The height of the source page or image in points or pixels.

pageRotation int

The detected rotation of the page in degrees clockwise (e.g., 0, 90, 180, or 270).

pageSkew double

The detected skew angle of the page in degrees clockwise.

OcrResult(IEnumerable<TextElement>)

Initializes a new instance of the OcrResult class with a collection of structured text elements returned from the OCR process, with no initial formatted text or page dimension metadata.

public OcrResult(IEnumerable<TextElement> textElements)

Parameters

textElements IEnumerable<TextElement>

The collection of TextElement instances representing recognized text spans and their layout information.

OcrResult(string)

Initializes a new instance of the OcrResult class with plain unstructured text only, without any layout or bounding box information.

public OcrResult(string text)

Parameters

text string

The unstructured text output produced by the OCR engine.