FirebaseVisionText.Element

public static class FirebaseVisionText.Element extends Object

Roughly equivalent to a space-separated "word" in most Latin languages, or a character in others. For instance, 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.
Float
getConfidence()
The confidence of the recognized text.
Point[]
getCornerPoints()
Gets the four corner points in clockwise direction starting with top-left.
List<RecognizedLanguage>
getRecognizedLanguages()
Gets a list of recognized languages together with confidence.
String
getText()
Gets the recognized text as a string.

Inherited Method Summary

Object
clone()
boolean
equals(Object arg0)
void
finalize()
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()

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 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.

ML Kit for Firebase menyediakan solusi ML siap pakai bagi developer aplikasi. Aplikasi baru harus menggunakan library ML Kit mandiri untuk ML di perangkat dan Firebase ML untuk ML berbasis cloud.

Diperbarui Feb 26, 2025

Dengan Firebase ML, Anda dapat menambahkan fitur machine learning yang canggih ke aplikasi Anda dengan API yang siap pakai dan dukungan untuk deployment model kustom.

Diperbarui Feb 26, 2025

ML Kit for Firebase menyediakan solusi ML siap pakai bagi developer aplikasi. Aplikasi baru harus menggunakan library ML Kit mandiri untuk ML di perangkat dan Firebase ML untuk ML berbasis cloud.

Diperbarui Feb 26, 2025