[[["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 2020-08-14 UTC."],[],[],null,["# FirebaseVisionObjectDetector\n\npublic class **FirebaseVisionObjectDetector** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Closeable](//developer.android.com/reference/java/io/Closeable.html) [Closeable](//developer.android.com/reference/java/io/Closeable.html) \n**This class is deprecated.** \n\nThe standalone ML Kit SDK replaces this API. For more information, refer to the [migration guide](//developers.google.com/ml-kit/migration).\n\nDetector for finding [FirebaseVisionObject](/docs/reference/android/com/google/firebase/ml/vision/objects/FirebaseVisionObject)s\nin a supplied image.\n\nA object detector is created via [getOnDeviceObjectDetector(FirebaseVisionObjectDetectorOptions)](/docs/reference/android/com/google/firebase/ml/vision/FirebaseVision#getOnDeviceObjectDetector(com.google.firebase.ml.vision.objects.FirebaseVisionObjectDetectorOptions)) or [getOnDeviceObjectDetector()](/docs/reference/android/com/google/firebase/ml/vision/FirebaseVision#getOnDeviceObjectDetector()), if you wish to use the default options. For example,\nthe code below creates an object detector with default options. \n\n FirebaseVisionObjectDetector objectDetector =\n FirebaseVision.getInstance().getOnDeviceObjectDetector();\n \nTo perform object detection in an image, you first need to create an instance of `\n`[FirebaseVisionImage](/docs/reference/android/com/google/firebase/ml/vision/common/FirebaseVisionImage) from a [Bitmap](//developer.android.com/reference/android/graphics/Bitmap.html), [ByteBuffer](//developer.android.com/reference/java/nio/ByteBuffer.html), etc. See [FirebaseVisionImage](/docs/reference/android/com/google/firebase/ml/vision/common/FirebaseVisionImage) documentation for more details. For example, the code below creates a [FirebaseVisionImage](/docs/reference/android/com/google/firebase/ml/vision/common/FirebaseVisionImage) from a [ByteBuffer](//developer.android.com/reference/java/nio/ByteBuffer.html). \n\n FirebaseVisionImage image\n = FirebaseVisionImage.fromByteBuffer(byteBuffer, imageMetadata);\n \nThen the code below can detect objects in the supplied [FirebaseVisionImage](/docs/reference/android/com/google/firebase/ml/vision/common/FirebaseVisionImage). \n\n\n Task\u003cList\u003cFirebaseVisionObject\u003e\u003e task = objectDetector.processImage(image);\n task.addOnSuccessListener(...).addOnFailureListener(...);\n \n### Public Method Summary\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| void | [close](/docs/reference/android/com/google/firebase/ml/vision/objects/FirebaseVisionObjectDetector#close())() |\n| [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html)\\\u003c[List](//developer.android.com/reference/java/util/List.html)\\\u003c[FirebaseVisionObject](/docs/reference/android/com/google/firebase/ml/vision/objects/FirebaseVisionObject)\\\u003e\\\u003e | [processImage](/docs/reference/android/com/google/firebase/ml/vision/objects/FirebaseVisionObjectDetector#processImage(com.google.firebase.ml.vision.common.FirebaseVisionImage))([FirebaseVisionImage](/docs/reference/android/com/google/firebase/ml/vision/common/FirebaseVisionImage) image) Detects objects from supplied image. |\n\n### Inherited Method Summary\n\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\nFrom interface java.io.Closeable \n\n|---------------|---------|\n| abstract void | close() |\n\nFrom interface java.lang.AutoCloseable \n\n|---------------|---------|\n| abstract void | close() |\n\nPublic Methods\n--------------\n\n#### public void **close** ()\n\n##### Throws\n\n| [IOException](//developer.android.com/reference/java/io/IOException.html) | |\n|---------------------------------------------------------------------------|---|\n\n#### public [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html)\\\u003c[List](//developer.android.com/reference/java/util/List.html)\\\u003c[FirebaseVisionObject](/docs/reference/android/com/google/firebase/ml/vision/objects/FirebaseVisionObject)\\\u003e\\\u003e\n**processImage** ([FirebaseVisionImage](/docs/reference/android/com/google/firebase/ml/vision/common/FirebaseVisionImage) image)\n\nDetects objects from supplied image.\n\nFor best efficiency, create a [FirebaseVisionImage](/docs/reference/android/com/google/firebase/ml/vision/common/FirebaseVisionImage) object using following way:\n\n- [fromByteBuffer(ByteBuffer, FirebaseVisionImageMetadata)](/docs/reference/android/com/google/firebase/ml/vision/common/FirebaseVisionImage#fromByteBuffer(java.nio.ByteBuffer, com.google.firebase.ml.vision.common.FirebaseVisionImageMetadata)) if you need to pre-process the image. E.g. allocate a direct [ByteBuffer](//developer.android.com/reference/java/nio/ByteBuffer.html) and write processed pixels into the [ByteBuffer](//developer.android.com/reference/java/nio/ByteBuffer.html).\n\nAll other [FirebaseVisionImage](/docs/reference/android/com/google/firebase/ml/vision/common/FirebaseVisionImage) factory methods will work as well, but possibly slightly slower.\n\nNote that the width and height of the provided image cannot be less than 32. \n\n##### Returns\n\n- A [Task](//developers.google.com/android/reference/com/google/android/gms/tasks/Task.html) that asynchronously returns a [List](//developer.android.com/reference/java/util/List.html) of detected [FirebaseVisionObject](/docs/reference/android/com/google/firebase/ml/vision/objects/FirebaseVisionObject)s."]]