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
textElementsIEnumerable<TextElement>The layout-aware text elements to associate with the OCR result.
pageWidthdoubleThe width of the source page or image in points or pixels.
pageHeightdoubleThe height of the source page or image in points or pixels.
pageRotationintThe detected rotation of the page in degrees clockwise (e.g., 0, 90, 180, or 270).
pageSkewdoubleThe 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
pageElementPageElementThe 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
textstringThe unstructured text output produced by the OCR engine.