Detector.Detections

TheMobile Vision API is deprecated and no longer maintained.It is now a part ofML Kit which includes all new on-device MLcapabilities. If you use Mobile Vision in your app today, follow themigration guide.
Also:"vision"
public static classDetector.Detections extendsObject

Detection result object containing both detected items and the associated frame metadata.

Public Method Summary

boolean
detectorIsOperational()
Returns true if the detector is operational, false if it is not operational.
SparseArray<T>
getDetectedItems()
Returns a collection of the detected items that were identified in the frame.
Frame.Metadata
getFrameMetadata()
Returns the metadata of the associated frame in which the detection originated.

Inherited Method Summary

From class java.lang.Object
Object
clone()
boolean
equals(Object arg0)
void
finalize()
finalClass<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()

Public Methods

public booleandetectorIsOperational()

Also: "vision"

Returns true if the detector is operational, false if it is not operational. In the non-operational case, the detector will return no results.

A detector may be non-operational for a while when starting an app for the first time, if a download is required to obtain the associated library and model files required to do detection.

publicSparseArray<T>getDetectedItems()

Also: "vision"

Returns a collection of the detected items that were identified in the frame.

Returns
  • mapping of int to detected object, where the int domain represents the consistent tracking ID of the associated item. As the same object is detected in consecutive frames, the detector will return the same ID for that item.

publicFrame.MetadatagetFrameMetadata()

Also: "vision"

Returns the metadata of the associated frame in which the detection originated.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2021-06-17 UTC.