Represents a space-separated segment in a line of text (for example, a word in most Latin languages). If a word is split between two lines by a hyphen, each part is encoded as a separate Element.
Public Method Summary
Rect |
getBoundingBox()
Returns the axis-aligned bounding rectangle of the detected text.
|
Point[] |
getCornerPoints()
Gets the four corner points in clockwise direction starting with top-left.
|
String |
getRecognizedLanguage()
Gets prevailing language in the text, if any.
|
String |
getText()
Gets the recognized text in the
Text.Element .
|
Inherited Method Summary
Public Methods
public Rect getBoundingBox ()
Returns the axis-aligned bounding rectangle of the detected text. If nothing found,
it returns null
.
public Point[] getCornerPoints ()
Gets the four corner points in clockwise direction starting with top-left. Due to
the possible perspective distortions, this is not necessarily a rectangle. Parts of the
region could be outside of the image. If nothing found, it returns
null
.
public String getRecognizedLanguage ()
Gets prevailing language in the text, if any. The format is in BCP47 (e.g. "en" or "sr-Latn-BA") or "und" if the language could not be determined.
public String getText ()
Gets the recognized text in the Text.Element
.
The recognized text is in reading order for the language. For Latin, it is left-to-right.
Returns an empty string if nothing is found.