| class info |
| com.huawei.hms.mlsdk.text.MLText.Base |
| 文本信息的父类,表示图像检测出的基本文本信息。 包含5个属性: 1、检测出的文本内容 2、文本的边框 3、文本边框的顶点 4、检测结果的置信度 5、检测到的所有语种 |
| 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() |
| 获取文本的轴对齐矩形边界框。 |
Return
| Type | desc |
| android.graphics.Rect | 返回文本的轴对齐矩形边界框。 |
Return
| Type | desc |
| List<? extends MLText.Base> | 返回当前文本对象包含的低一级的文本对象, 例如:如果当前对象是文本行(TextLine),则返回文本元素(Word)集合。 |
| Method |
| public String getLanguage() |
| 获取文本中出现次数最多的语种。 |
Return
| Type | desc |
| String | 返回语种,语种使用语言代码表示,可能返回的语种有: “en”(英),“zh”(中),“ja”(日), “ko”(韩),“ru”(俄),“de”(德), “fr”(法),“it”(意大利),“pt”(葡萄牙), “es”(西班牙),“rm”(拉丁语系语言); 云侧接口还支持语种: “pl”(波兰),“no”(挪威),“sv”(瑞典), “da”(丹麦),“tr”(土耳其),“fi”(芬兰), “th”(泰语),“ar”(阿拉伯语),“hi”(印地语)。 |
| Method |
| public List<TextLanguage> getLanguageList() |
| 获取检测出的语种。 |
Return
| Type | desc |
| List<TextLanguage> | 返回语种列表,语种使用语言代码表示,可能返回的语种有: “en”(英),“zh”(中),“ja”(日),“ko”(韩), “ru”(俄),“de”(德),“fr”(法),“it”(意大利), “pt”(葡萄牙),“es”(西班牙),“rm”(拉丁语系语言); 云侧接口还支持语种:“pl”(波兰),“no”(挪威), “sv”(瑞典),“da”(丹麦),“tr”(土耳其), “fi”(芬兰),“th”(泰语),“ar”(阿拉伯语), “hi”(印地语)。 |
| Method |
| public Float getPossibility() |
| 获取检测结果置信度。 |
Return
| Type | desc |
| Float | 返回置信度,取值范围0.0-1.0,置信度越高说明检测结果越准确。仅在云端检测的情况下返回置信度信息。 |
| Method |
| public String getStringValue() |
| 获取检测到的文本内容。 |
Return
| Type | desc |
| String | 返回文本内容。 |
| Method |
| public android.graphics.Point[] getVertexes() |
| 获取文本边框的顶点。 |
Return
| Type | desc |
| android.graphics.Point[] | 返回文本边框的顶点,返回的数组中第一个点对应文本边框的左上角的顶点, 顶点按顺时针顺序排列。 |