DetectedObject
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
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 boolean equals (Object o)
Indicates whether some other object is "equal to" this one.
public Rect getBoundingBox ()
Gets the axis-aligned bounding rectangle of the detected object.
Returns a list of DetectedObject.Label
for the detected object, when classification is enabled.
The labels are returned sorted by confidence in descending order.
An empty list will be returned if classification is not enabled or there isn't any
label with a confidence score greater than the threshold.
public int hashCode ()
Returns a hash code value for the object.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eDetectedObject\u003c/code\u003e represents an object identified by the ML Kit ObjectDetector, providing information about its location and potentially its classification.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to access the object's bounding box, labels (if classification is enabled), and tracking ID (in stream mode).\u003c/p\u003e\n"],["\u003cp\u003eLabels associated with the object are sorted by confidence, and an empty list is returned if classification is disabled or no labels meet the confidence threshold.\u003c/p\u003e\n"],["\u003cp\u003eTracking ID is a non-negative number in stream mode and null in single image mode, helping to track the object across frames.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDetectedObject\u003c/code\u003e inherits standard methods from \u003ccode\u003ejava.lang.Object\u003c/code\u003e such as \u003ccode\u003eequals\u003c/code\u003e, \u003ccode\u003ehashCode\u003c/code\u003e, and \u003ccode\u003etoString\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["public class **DetectedObject** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nRepresents an object detected by [ObjectDetector](/android/reference/com/google/mlkit/vision/objects/ObjectDetector). \n\nNested Class Summary\n\n|-------|---|---|-------------------------------------------------|\n| class | [DetectedObject.Label](/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label) || Represents an image label of a detected object. |\n\nPublic Method Summary\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/mlkit/vision/objects/DetectedObject#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) o) Indicates whether some other object is \"equal to\" this one. |\n| [Rect](//developer.android.com/reference/android/graphics/Rect.html) | [getBoundingBox](/android/reference/com/google/mlkit/vision/objects/DetectedObject#getBoundingBox())() Gets the axis-aligned bounding rectangle of the detected object. |\n| [List](//developer.android.com/reference/java/util/List.html)\\\u003c[DetectedObject.Label](/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label)\\\u003e | [getLabels](/android/reference/com/google/mlkit/vision/objects/DetectedObject#getLabels())() Returns a list of [DetectedObject.Label](/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label) for the detected object, when classification is enabled. |\n| [Integer](//developer.android.com/reference/java/lang/Integer.html) | [getTrackingId](/android/reference/com/google/mlkit/vision/objects/DetectedObject#getTrackingId())() Gets the tracking ID of the object. |\n| int | [hashCode](/android/reference/com/google/mlkit/vision/objects/DetectedObject#hashCode())() Returns a hash code value for the object. |\n\nInherited Method Summary \nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods \n\npublic boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) o) \nIndicates whether some other object is \"equal to\" this one. \n\npublic [Rect](//developer.android.com/reference/android/graphics/Rect.html) **getBoundingBox** () \nGets the axis-aligned bounding rectangle of the detected object. \n\npublic [List](//developer.android.com/reference/java/util/List.html)\\\u003c[DetectedObject.Label](/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label)\\\u003e\n**getLabels** () \nReturns a list of [DetectedObject.Label](/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label)\nfor the detected object, when classification is enabled.\n\nThe labels are returned sorted by confidence in descending order.\n\nAn empty list will be returned if classification is not enabled or there isn't any\nlabel with a confidence score greater than the threshold. \n\npublic [Integer](//developer.android.com/reference/java/lang/Integer.html) **getTrackingId** () \nGets the tracking ID of the object.\n\nThe ID is a non-negative number in [ObjectDetectorOptionsBase.STREAM_MODE](/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase#STREAM_MODE) and `null` in\n[ObjectDetectorOptionsBase.SINGLE_IMAGE_MODE](/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase#SINGLE_IMAGE_MODE). \n\npublic int **hashCode** () \nReturns a hash code value for the object."]]