public final class

MlKitAnalyzer.Result

extends java.lang.Object

 java.lang.Object

↳androidx.camera.mlkit.vision.MlKitAnalyzer.Result

Overview

The aggregated MLKit result of a camera frame.

Summary

Constructors
publicResult(java.util.Map<, java.lang.Object> values, long timestamp, java.util.Map<, java.lang.Throwable> throwables)

Methods
public java.lang.ThrowablegetThrowable(<any> detector)

The error returned from the given Detector.

public longgetTimestamp()

The timestamp of the camera frame.

public java.lang.ObjectgetValue(<any> detector)

Get the analysis result for the given ML Kit Detector.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Result(java.util.Map<, java.lang.Object> values, long timestamp, java.util.Map<, java.lang.Throwable> throwables)

Methods

public java.lang.Object getValue(<any> detector)

Get the analysis result for the given ML Kit Detector.

Returns null if the detection is unsuccessful.

This method and MlKitAnalyzer.Result.getThrowable() may both return null. For example, when a face detector processes a frame successfully and does not detect any faces. However, if MlKitAnalyzer.Result.getThrowable() returns a non-null java.lang.Throwable, then this method will always return null.

Parameters:

detector: has to be one of the Detectors provided in MlKitAnalyzer's constructor.

public java.lang.Throwable getThrowable(<any> detector)

The error returned from the given Detector.

Returns null if the Detector finishes without exceptions.

Parameters:

detector: has to be one of the Detectors provided in MlKitAnalyzer's constructor.

public long getTimestamp()

The timestamp of the camera frame.

The timestamp of the camera frame based on which the analysis result is produced. This is the value of ImageProxy.