目录

MLDocument

Class Info

com.huawei.hms.mlsdk.document.MLDocument

表示图像检测出的文档信息。包含两个属性:
  • 图像中检测到的所有文本内容。
  • 图像中检测到的所有文本区块,包含文本内容、文本区块边界和语种等信息。

Nested Class Summary

Qualifier and Type

Class Name and Description

static class

MLDocument.Base

文档信息的父类,表示检测出的基本文档信息,包含5个属性:
  • 检测出的语种列表。
  • 文本的间隔。
  • 文本边框的顶点。
  • 检测出的文本内容。
  • 检测结果的置信度。

static class

MLDocument.Block

用来表示检测出的文本区块。

static class

MLDocument.Character

用来描述检测出的单一字符,是模型能识别的最小元素。

static class

MLDocument.Interval

用于表示文本间隔。

static class

MLDocument.Line

用来表示检测出的行。

static class

MLDocument.Section

用来表示检测出的段落。

static class

MLDocument.Word

用来描述检测出的词。

Public Method Summary

Qualifier and Type

Method Name and Description

List<MLDocument.Block>

getBlocks()

获取图像中检测到的所有文本区块。

String

getStringValue()

获取图像中检测到的所有文本内容。

Public Methods

[h2]getBlocks()

Method

public List<MLDocument.Block> getBlocks()

获取图像中检测到的所有文本区块,包含段落、文字、区块边界和语种等信息。

Returns

Type

Description

List<MLDocument.Block>

返回文本区块列表。

[h2]getStringValue()

Method

public String getStringValue()

获取图像中检测到的所有文本内容。

Returns

Type

Description

String

返回文本内容。