目录

class info
com.huawei.hms.mlsdk.common.MLResultTrailer
Represents an abstract class of an object tracker, which can track the detection results of a specific object in consecutive frames to identify the object appearance, change, disappearance, and processing completion. Each scenario corresponds to a processing method where you can customize the processing logic.

Public Constructor Summary

Constructor name
MLResultTrailer()
Instantiates MLResultTrailer.

Public Method Summary

Return typeMethod name
voidcompleteCallback()
voidlostCallback(MLAnalyzer.Result<T> result)
voidobjectCreateCallback(int itemId, T obj)
voidobjectUpdateCallback(MLAnalyzer.Result<T> result, T obj)

Public Constructors

Method
public MLResultTrailer()
Instantiates MLResultTrailer.

Public Methods

Method
public void completeCallback()
Represents a callback method that is called when the object disappears from the current frame and the number of consecutive frames without the presence of the object exceeds the threshold, or the current object is no longer concerned.
Method
public void lostCallback(MLAnalyzer.Result<T> result)
Represents a callback method that is called when the object disappears from the current frame and the number of consecutive frames without the presence of the object does not exceed the threshold.

Parameters

Parameter nameParameter desc
resultDetection result of the current object.
Method
public void objectCreateCallback(int itemId, T obj)
Represents a callback method that is called when a new object is detected.

Parameters

Parameter nameParameter desc
itemIdID of a new object.
objNew object, for example, an MLFace instance.
Method
public void objectUpdateCallback(MLAnalyzer.Result<T> result, T obj)
Represents a callback method that is called when the object detected from the current frame is the same as that detected from the previous frame.

Parameters

Parameter nameParameter desc
resultDetection result of the current object.
objCurrent object, for example, an MLFace instance.