FirebaseVisionText.TextBlock

public static class FirebaseVisionText.TextBlock extends Object

A block of text (think of it as a paragraph) as deemed by the OCR engine.

Public Method Summary

Rect
getBoundingBox()
Returns the axis-aligned bounding rectangle of the detected text.
Float
getConfidence()
The confidence of the recognized text.
Point[]
getCornerPoints()
Gets the four corner points in clockwise direction starting with top-left.
synchronized List<FirebaseVisionText.Line>
getLines()
Gets an unmodifiable list of FirebaseVisionText.Lines that make up this text block.
List<RecognizedLanguage>
getRecognizedLanguages()
Gets a list of recognized languages together with confidence.
String
getText()
Gets the recognized text as a string.

Inherited Method Summary

Public Methods

public Rect getBoundingBox ()

Returns the axis-aligned bounding rectangle of the detected text.

public Float getConfidence ()

The confidence of the recognized text.

The value is returned only for cloud recognizers that are configured with DENSE_MODEL.

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.

The value is only valid for on-device text recognition.

public synchronized List<FirebaseVisionText.Line> getLines ()

Gets an unmodifiable list of FirebaseVisionText.Lines that make up this text block.

public List<RecognizedLanguage> getRecognizedLanguages ()

Gets a list of recognized languages together with confidence. (Cloud API only.)

public String getText ()

Gets 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 a Line.

Returns an empty string if nothing is found.