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.

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(PageElement)

Initializes a new instance of the OcrResult class from an existing PageElement, cloning it to preserve the original layout and text data.

[JsonConstructor]
public OcrResult(PageElement pageElement)

Parameters

pageElement PageElement

The PageElement to clone, which encapsulates page dimensions (width, height), rotation, skew, and the collection of TextElement instances representing the recognized text and its layout.

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.