public class

Line

extends Object
implements Text
java.lang.Object
   ↳ com.google.android.gms.vision.text.Line

Class Overview

A line of text.

Summary

Public Methods
float getAngle()
Angle of rotation (in degrees, clockwise being positive) of its bounding box about the top-left corner.
Rect getBoundingBox()
Axis-aligned bounding box containing the text.
List<? extends Text> getComponents()
Smaller components that comprise this entity, if any.
Point[] getCornerPoints()
Four corner points in clockwise direction starting with top-left.
String getLanguage()
String getValue()
Retrieve the recognized text as a string.
boolean isVertical()
Whether or not the text layout is vertical.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.android.gms.vision.text.Text

Public Methods

public float getAngle ()

Angle of rotation (in degrees, clockwise being positive) of its bounding box about the top-left corner.

Returns
float

public Rect getBoundingBox ()

Axis-aligned bounding box containing the text. The bounding box may extend past the image boundary.

Returns
Rect

public List<? extends Text> getComponents ()

Smaller components that comprise this entity, if any. If this entity is an atom, an empty list is returned. TextBlock is at the top of the Text hierarchy. TextBlock contains Line objects, which contains Elements. Elements are atoms. We may decide to add character-level objects in later versions.

For example, a client could draw bounding boxes for recognized text in different colors for paragraphs, lines, words, and alphabets by repeatedly traversing down the tree with this method.

Returns
List<? extends Text>

public Point[] getCornerPoints ()

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.

Returns
Point[]

public String getLanguage ()

Returns
String

public String getValue ()

Retrieve the recognized text as a string. Returned in reading order for the language. For Latin, this is top to bottom within a TextBlock, and left-to-right within Lines.

Returns
String

public boolean isVertical ()

Whether or not the text layout is vertical.

Returns
boolean