Class OcrResult
- Namespace
- LMKit.Extraction.Ocr
- Assembly
- LM-Kit.NET.dll
Represents the result of an OCR operation, encapsulating the recognized text and its optional positional layout within the source image.
[Obfuscation(Exclude = true)]
public sealed class OcrResult
- Inheritance
-
OcrResult
- Inherited Members
Examples
Example: Create an OcrResult with plain text
var result = new OcrResult("Invoice #12345\nTotal: $99.00");
Console.WriteLine(result.PageText);
Example: Serialize and deserialize an OcrResult
string json = ocrResult.ToJson();
OcrResult restored = OcrResult.FromJson(json);
Console.WriteLine(restored.PageText);
Constructors
- OcrResult(PageElement)
Initializes a new instance of the OcrResult class from an existing PageElement, cloning it to preserve the original layout and text data.
- 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.
- OcrResult(string)
Initializes a new instance of the OcrResult class with plain unstructured text only, without any layout or bounding box information.
Fields
- ContentConfidenceRejectionThreshold
Content confidence below which the recognized content should be treated as recognition noise and discarded. See ContentConfidence.
- ContentConfidenceReviewThreshold
Content confidence at or above which the recognized content can be trusted as genuine text without human review. See ContentConfidence.
Properties
- ContentConfidence
Gets or sets the confidence, in the 0..1 range, that the recognized content of this page is genuine text rather than recognition noise.
- LanguageCodes
The dictionary codes the engine read with, joined with
+when several ("eng+fra"); null when the engine does not report them.
- PageElement
Gets the underlying PageElement, which encapsulates all of the layout information for this OCR result, page dimensions (width, height), rotation, skew, and the full collection of TextElement instances.
- PageHeight
Gets the height of the page in the original document, in points.
- PageRotation
Gets the detected rotation of the page in degrees clockwise (e.g., 0, 90, 180, or 270).
- PageSkew
Gets the detected skew angle of the page in degrees clockwise.
- PageText
Gets the full textual content of the page as a single aggregated string.
- PageWidth
Gets the width of the page in the original document, in points.
- TextElements
Gets the collection of TextElement instances found on the page. Each text element may optionally include bounding box coordinates describing its layout.
- Underlines
Gets or sets the underlines the engine found under the page's text lines and lifted before recognizing them, in the frame of TextElements. Empty when the page carries none or the engine does not report them.
Methods
- FromJson(string)
Deserializes the specified JSON string into an OcrResult instance.