| class info |
| com.huawei.hms.mlsdk.text.MLText.Base |
| Represents the parent class of text information, which is the basic information about text detected in an image. Five attributes are included: 1. Detected text content 2. Text bounding box 3. Corner points of the text bounding box 4. Confidence of the detection result 5. All detected languages |
| Return type | Method name |
| android.graphics.Rect | getBorder() |
| List<? extends MLText.Base> | getContents() |
| String | getLanguage() |
| List | getLanguageList() |
| Float | getPossibility() |
| String | getStringValue() |
| android.graphics.Point[] | getVertexes() |
| Method |
| public android.graphics.Rect getBorder() |
| Obtains the axis-aligned bounding rectangle of the text. |
Return
| Type | desc |
| android.graphics.Rect | Returns the axis-aligned bounding rectangle of the text. |
Return
| Type | desc |
| List<? extends MLText.Base> | Returns the lower-level text object contained in the current text object. For example, if the current object is TextLine, a set of Word is returned. |
| Method |
| public String getLanguage() |
| Obtains the language that appears most frequently in the text. |
Return
| Type | desc |
| String | Returns the language code. Supported languages: en (English), zh (Chinese), ja (Japanese), ko (Korean), ru (Russian), de (German), fr (French), it (Italian), pt (Portuguese), es (Spanish), and rm (Romance languages) The cloud API also supports the following languages: pl (Polish), no (Norwegian), sv (Swedish), da (Danish), tr (Turkish), fi (Finnish), th (Thai), ar (Arabic), and hi (Hindi) |
| Method |
| public List<TextLanguage> getLanguageList() |
| Obtains the detected languages. |
Return
| Type | desc |
| List<TextLanguage> | Returns a list of language codes. Supported languages: en (English), zh (Chinese), ja (Japanese), ko (Korean), ru (Russian), de (German), fr (French), it (Italian), pt (Portuguese), es (Spanish), and rm (Romance languages) The cloud API also supports the following languages: pl (Polish), no (Norwegian), sv (Swedish), da (Danish), tr (Turkish), fi (Finnish), th (Thai), ar (Arabic), and hi (Hindi) |
| Method |
| public Float getPossibility() |
| Obtains the confidence of the detection result. |
Return
| Type | desc |
| Float | Returns the confidence. The value range is 0.0–1.0. A higher confidence indicates a more accurate detection result. Confidence information is returned only if on-cloud detection is performed. |
| Method |
| public String getStringValue() |
| Obtains the detected text content. |
Return
| Type | desc |
| String | Returns the text content. |
| Method |
| public android.graphics.Point[] getVertexes() |
| Obtains the corner points of the text bounding box. |
Return
| Type | desc |
| android.graphics.Point[] | Returns the corner points of the text bounding box. The first point in the returned array corresponds to the upper-left corner point of the text bounding box. Corner points are arranged in the clockwise sequence. |