Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface OcrResult

Package version

An interface representing OcrResult.

Hierarchy

  • OcrResult

Index

Properties

Optional language

language: undefined | string

The BCP-47 language code of the text in the image.

Optional orientation

orientation: undefined | string

Orientation of the text recognized in the image, if requested. The value (up, down, left, or right) refers to the direction that the top of the recognized text is facing, after the image has been rotated around its center according to the detected text angle (see textAngle property). If detection of the orientation was not requested, or no text is detected, the value is 'NotDetected'.

Optional regions

regions: OcrRegion[]

An array of objects, where each object represents a region of recognized text.

Optional textAngle

textAngle: undefined | number

The angle, in radians, of the detected text with respect to the closest horizontal or vertical direction. After rotating the input image clockwise by this angle, the recognized text lines become horizontal or vertical. In combination with the orientation property it can be used to overlay recognition results correctly on the original image, by rotating either the original image or recognition results by a suitable angle around the center of the original image. If the angle cannot be confidently detected, this property is not present. If the image contains text at different angles, only part of the text will be recognized correctly.

Generated using TypeDoc