# DetectedObject

public class **DetectedObject** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
Represents an object detected by `https://developers.google.com/android/reference/com/google/mlkit/vision/objects/ObjectDetector`.

### Nested Class Summary

|---|---|---|---|
| class | [DetectedObject.Label](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label) || Represents an image label of a detected object. |

### Public Method Summary

|---|---|
| boolean | [equals](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject#equals(java.lang.Object))([Object](https://developer.android.com/reference/java/lang/Object.html) o) Indicates whether some other object is "equal to" this one. |
| [Rect](https://developer.android.com/reference/android/graphics/Rect.html) | [getBoundingBox](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject#getBoundingBox())() Gets the axis-aligned bounding rectangle of the detected object. |
| [List](https://developer.android.com/reference/java/util/List.html)\<[DetectedObject.Label](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label)\> | [getLabels](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject#getLabels())() Returns a list of `https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label` for the detected object, when classification is enabled. |
| [Integer](https://developer.android.com/reference/java/lang/Integer.html) | [getTrackingId](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject#getTrackingId())() Gets the tracking ID of the object. |
| int | [hashCode](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject#hashCode())() Returns a hash code value for the object. |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public boolean **equals** ([Object](https://developer.android.com/reference/java/lang/Object.html) o)

Indicates whether some other object is "equal to" this one.

#### public [Rect](https://developer.android.com/reference/android/graphics/Rect.html) **getBoundingBox** ()

Gets the axis-aligned bounding rectangle of the detected object.

#### public [List](https://developer.android.com/reference/java/util/List.html)\<[DetectedObject.Label](https://developers.google.com/android/reference/com/google/mlkit/vision/objects/DetectedObject.Label)\>
**getLabels** ()

Returns a list of `https://developers.google.com/android/reference/com/google/mlkit/vision/objects/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 [Integer](https://developer.android.com/reference/java/lang/Integer.html) **getTrackingId** ()

Gets the tracking ID of the object.

The ID is a non-negative number in `https://developers.google.com/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase#STREAM_MODE` and `null` in
`https://developers.google.com/android/reference/com/google/mlkit/vision/objects/ObjectDetectorOptionsBase#SINGLE_IMAGE_MODE`.

#### public int **hashCode** ()

Returns a hash code value for the object.