目录

class info
com.huawei.hms.mlsdk.text.MLRemoteTextSetting.Factory
Creates an instance of the on-cloud text analysis configurator to set on-cloud text detection attributes.

Public Constructor Summary

Constructor name
Factory()
Creates an instance of the text analysis configurator.

Public Method Summary

Return typeMethod name
MLRemoteTextSettingcreate()
MLRemoteTextSetting.FactorysetBorderType(String borderType)
MLRemoteTextSetting.FactorysetLanguageList(List<String>languageList)
MLRemoteTextSetting.FactorysetTextDensityScene(int textType)

Public Constructors

Method
public Factory()
Creates an instance of the text analysis configurator.

Public Methods

Method
public MLRemoteTextSetting create()
Creates an instance of the text analysis configurator.

Return

Typedesc
MLRemoteTextSettingReturns the instance of the text analysis configurator MLRemoteTextSetting.
Method
public MLRemoteTextSetting.Factory setBorderType(String borderType)
Sets the type of the text bounding box. The analyzer returns the coordinates of the corner points of the text bounding box that is a quadrilateral or the coordinates of the corner points of the text bounding box that is a polygon for text in a curved layout, depending on the setting.

Parameters

Parameter nameParameter desc
borderTypeType of the text bounding box:
NGON:Returns the coordinates of the four corner points of the text bounding box
that is a quadrilateral.
ARC: Returns the coordinates of up to 72 corner points of the text bounding box
that is a polygon for text in a curved layout.


Return

Typedesc
MLRemoteTextSetting.FactoryMLRemoteTextSetting.Factory
Method
public MLRemoteTextSetting.Factory setLanguageList(List<String>languageList)
Sets the preset languages to be detected. Correct language setting ensures fast and accurate detection. Do not set this parameter if languages are not determined. The service will automatically detect languages.

Parameters

Parameter nameParameter desc
languageListLanguage code list.
Supported languages:
en (English), zh (Chinese), ja (Japanese),
ko (Korean), ru (Russian), de (German),
fr (French), it (Italian), pt (Portuguese),
es (Spanish), pl (Polish), no (Norwegian),
sv (Swedish), da (Danish), tr (Turkish),
fi (Finnish), th (Thai), ar (Arabic),
and hi (Hindi)


Return

Typedesc
MLRemoteTextSetting.FactoryMLRemoteTextSetting.Factory
Method
public MLRemoteTextSetting.Factory setTextDensityScene(int textType)
Sets the type of text to be detected. The analyzer calls an appropriate cloud API for text detection based on the text type.

Parameters

Parameter nameParameter desc
textTypeType of text to be detected.
1: OCR_LOOSE_SCENE, indicating sparse text
2: OCR_COMPACT_SCENE, indicating dense text


Return

Typedesc
MLRemoteTextSetting.FactoryMLRemoteTextSetting.Factory instance.