OcrResult OcrResult OcrResult OcrResult Class

Definition

Contains the results of Optical Character Recognition (OCR).

public : sealed class OcrResult : IOcrResultpublic sealed class OcrResult : IOcrResultPublic NotInheritable Class OcrResult Implements IOcrResult// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

When you call the RecognizeAsync method of the OcrEngine class, the method returns an OcrResult object. The OcrResult contains a collection of OcrLine objects, which you access through the Lines property of the OcrResult. Each OcrLine object contains a collection of OcrWord objects, which you access through the Words property of each OcrLine.

Properties

Lines Lines Lines Lines

Gets the collection of OcrLine objects that represents the lines of text detected in the image by the RecognizeAsync method.

public : IVectorView<OcrLine> Lines { get; }public IReadOnlyList<OcrLine> Lines { get; }Public ReadOnly Property Lines As IReadOnlyList<OcrLine>// You can use this property in JavaScript.
Value
IVectorView<OcrLine> IReadOnlyList<OcrLine> IReadOnlyList<OcrLine> IReadOnlyList<OcrLine>

The collection of OcrLine objects that represents the lines of text detected in the image by the RecognizeAsync method.

Remarks

When you call the RecognizeAsync method of the OcrEngine class, the method returns an OcrResult object. The OcrResult contains a collection of OcrLine objects, which you access through the Lines property of the OcrResult. Each OcrLine object contains a collection of OcrWord objects, which you access through the Words property of each OcrLine.

Text Text Text Text

Gets the recognized text.

public : PlatForm::String Text { get; }public string Text { get; }Public ReadOnly Property Text As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The recognized text.

TextAngle TextAngle TextAngle TextAngle

Gets the clockwise rotation of the recognized text, in degrees, around the center of the image.

public : IReference<double> TextAngle { get; }public Nullable<double> TextAngle { get; }Public ReadOnly Property TextAngle As Nullable<double>// You can use this property in JavaScript.
Value
IReference<double> Nullable<double> Nullable<double> Nullable<double>

The clockwise rotation of the recognized text, in degrees, around the center of the image. If the angle of the text can't be detected, the value of this property is null. If the image contains text at different angles, only part of the text will be recognized correctly.

Remarks

Use the TextAngle property to overlay recognition results correctly on the original image. If the value of the TextAngle property is not null or 0 (zero), then to overlay the recognized text correctly on the original image, you either have to rotate the original image by the detected angle in a counter-clockwise direction, or rotate the recognized text by the detected angle in a clockwise direction.

Example of text angle in an image

See Also