目录

class info
com.huawei.hms.mlsdk.text.MLLocalTextSetting

Sets the on-device detection attributes of the text analyzer (MLTextAnalyzer) to call the on-device algorithm API for detecting text in an image.The analyzer attributes include:
1. Preset languages. Set languages for the analyzer correctly to ensure fast and accurate detection.
2. On-device detection mode: independent detection mode or tracking mode

Constant Summary

TypeNameDesc
intOCR_DETECT_MODEIndependent detection mode.
Each supplied image is detected independently.
This mode applies to single image detection.
intOCR_TRACKING_MODETracking mode.
The detection result of the preceding frame is used as the basis to quickly detect
the text position in the image.
This mode applies to video stream text detection.

Public Method Summary

Return typeMethod name
booleanequals(Object object)
StringgetLanguage()
intgetOCRMode()
inthashCode()

Constants

Constant
public static final int OCR_DETECT_MODE
Independent detection mode. Each supplied image is detected independently. This mode applies to single image detection.
Constant value: 1
Constant
public static final int OCR_TRACKING_MODE
Tracking mode. The detection result of the preceding frame is used as the basis to quickly detect the text position in the image. This mode applies to video stream text detection.
Constant value: 2

Public Methods

Method
public boolean equals(Object object)
Determines whether the input instance is equal to the current instance.

Parameters

Parameter nameParameter desc
objectInstance to be compared.


Return

Typedesc
booleantrue: The instances are equal.
false: The instances are not equal.
Method
public String getLanguage()
Obtains the languages preset in the text analyzer.

Return

Typedesc
StringReturns 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), and es (Spanish)
Method
public int getOCRMode()
Obtains the detection mode.

Return

Typedesc
intReturns the detection mode.
1: OCR_DETECT_MODE, indicating the independent detection mode
2: OCR_TRACKING_MODE, indicating the tracking mode
Method
public int hashCode()
Obtains the hash value of the current instance.

Return

Typedesc
intReturns the hash value of the instance.