Stay organized with collectionsSave and categorize content based on your preferences.
public static final enumConfig.DepthMode
Selects the desired depth mode. Not all devices support all modes. UseSession.isDepthModeSupported(Config.DepthMode)to find whether the current device and the selected camera
supports a particular depth mode.
Onsupported devices, the best
possible depth is estimated based on hardware and software sources. Available sources of
automatic depth are:
Depth from motion, using the main RGB camera
Hardware depth sensor, such as a time-of-flight sensor (or ToF sensor)
Provides depth estimation for every pixel in the image, and works best for static scenes.
Adds significant computational load.
With this mode enabled,Frame.hitTest(MotionEvent)also returnsDepthPointin the
outputList<HitResult>, which are sampled from the generated depth image for the
current frame if available.
[[["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\u003eConfig.DepthMode\u003c/code\u003e selects the depth mode for ARCore, with options for automatic, disabled, or raw depth data.\u003c/p\u003e\n"],["\u003cp\u003eAutomatic mode uses hardware/software to estimate depth, providing depth for every pixel but with higher computational load.\u003c/p\u003e\n"],["\u003cp\u003eDisabled mode provides no depth information, and Raw Depth Only mode provides unfiltered depth images on supported devices.\u003c/p\u003e\n"],["\u003cp\u003eUse \u003ccode\u003eSession.isDepthModeSupported()\u003c/code\u003e to check device compatibility for specific depth modes before enabling them.\u003c/p\u003e\n"],["\u003cp\u003eRaw depth data is suitable for understanding environment geometry and is available in both Automatic and Raw Depth Only modes.\u003c/p\u003e\n"]]],["`Config.DepthMode` selects the depth mode, with device support checked via `Session.isDepthModeSupported`. Available modes are `AUTOMATIC`, `DISABLED`, and `RAW_DEPTH_ONLY`. `AUTOMATIC` estimates depth using hardware and software, providing depth for each pixel and supporting `DepthPoint` in `Frame.hitTest` results. `DISABLED` provides no depth information, throwing exceptions when calling `Frame.acquireDepthImage16Bits()`. `RAW_DEPTH_ONLY` offers unfiltered depth and confidence images, with sparse data and 0 value pixels for invalid depths.\n"],null,["# Config.DepthMode\n\n`\npublic static final enum\n`**Config.DepthMode**`\n` \nSelects the desired depth mode. Not all devices support all modes. Use [Session.isDepthModeSupported(Config.DepthMode)](/ar/reference/java/com/google/ar/core/Session#isDepthModeSupported(com.google.ar.core.Config.DepthMode)) to find whether the current device and the selected camera\nsupports a particular depth mode. \n\nInherited Methods\n-----------------\n\nFrom `class\njava.lang.Enum` \n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` final `[Object](https://developer.android.com/reference/java/lang/Object)` ` | clone`()` |\n| ` final int ` | compareTo`(`[Config.DepthMode](/ar/reference/java/com/google/ar/core/Config.DepthMode)` arg0)` |\n| ` int ` | compareTo`(`[Object](https://developer.android.com/reference/java/lang/Object)` arg0)` |\n| ` final Optional\u003cEnumDesc\u003c`[Config.DepthMode](/ar/reference/java/com/google/ar/core/Config.DepthMode)`\u003e\u003e ` | describeConstable`()` |\n| ` final boolean ` | equals`(`[Object](https://developer.android.com/reference/java/lang/Object)` arg0)` |\n| ` final void ` | finalize`()` |\n| ` final `[Class](https://developer.android.com/reference/java/lang/Class)`\u003c`[Config.DepthMode](/ar/reference/java/com/google/ar/core/Config.DepthMode)`\u003e ` | getDeclaringClass`()` |\n| ` final int ` | hashCode`()` |\n| ` final `[String](https://developer.android.com/reference/java/lang/String)` ` | name`()` |\n| ` final int ` | ordinal`()` |\n| ` `[String](https://developer.android.com/reference/java/lang/String)` ` | toString`()` |\n| ` static \u003cT extends `[Enum](https://developer.android.com/reference/java/lang/Enum)`\u003cT\u003e\u003e T ` | valueOf`(`[Class](https://developer.android.com/reference/java/lang/Class)`\u003cT\u003e arg0, `[String](https://developer.android.com/reference/java/lang/String)` arg1)` |\n\nFrom `class\njava.lang.Object` \n\n|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\n| ` `[Object](https://developer.android.com/reference/java/lang/Object)` ` | clone`()` |\n| ` boolean ` | equals`(`[Object](https://developer.android.com/reference/java/lang/Object)` arg0)` |\n| ` void ` | finalize`()` |\n| ` final `[Class](https://developer.android.com/reference/java/lang/Class)`\u003c?\u003e ` | getClass`()` |\n| ` int ` | hashCode`()` |\n| ` final void ` | notify`()` |\n| ` final void ` | notifyAll`()` |\n| ` `[String](https://developer.android.com/reference/java/lang/String)` ` | toString`()` |\n| ` final void ` | wait`(long arg0, int arg1)` |\n| ` final void ` | wait`(long arg0)` |\n| ` final void ` | wait`()` |\n\nFrom `interface\njava.lang.constant.Constable` \n\n|-----------------------------------------------|-----------------------|\n| ` abstract Optional\u003c? extends ConstantDesc\u003e ` | describeConstable`()` |\n\nFrom `interface\njava.lang.Comparable` \n\n|------------------|------------------------------------------------------------------------------------------------|\n| ` abstract int ` | compareTo`(`[Config.DepthMode](/ar/reference/java/com/google/ar/core/Config.DepthMode)` arg0)` |\n\nEnum Values\n-----------\n\n#### public\nstatic\nfinal\nConfig.DepthMode\nAUTOMATIC\n\n### AUTOMATIC\n\n```java\npublic static final Config.DepthMode AUTOMATIC\n``` \nOn [supported devices](https://developers.google.com/ar/devices), the best\npossible depth is estimated based on hardware and software sources. Available sources of\nautomatic depth are:\n\n- Depth from motion, using the main RGB camera\n- Hardware depth sensor, such as a time-of-flight sensor (or ToF sensor)\n\nProvides depth estimation for every pixel in the image, and works best for static scenes. Adds significant computational load.\n\nWith this mode enabled, [Frame.hitTest(MotionEvent)](/ar/reference/java/com/google/ar/core/Frame#hitTest(android.view.MotionEvent)) also returns [DepthPoint](/ar/reference/java/com/google/ar/core/DepthPoint) in the\noutput `List\u003cHitResult\u003e`, which are sampled from the generated depth image for the\ncurrent frame if available.\n\n#### public\nstatic\nfinal\nConfig.DepthMode\nDISABLED\n\n### DISABLED\n\n```java\npublic static final Config.DepthMode DISABLED\n``` \nNo depth information will be provided. Calling [Frame.acquireDepthImage16Bits()](/ar/reference/java/com/google/ar/core/Frame#acquireDepthImage16Bits()) throws\n[IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException).\n\n#### public\nstatic\nfinal\nConfig.DepthMode\nRAW_DEPTH_ONLY\n\n### RAW_DEPTH_ONLY\n\n```java\npublic static final Config.DepthMode RAW_DEPTH_ONLY\n``` \nOn [ARCore supported devices](https://developers.google.com/ar/devices) that also\nsupport the Depth API, provides a \"raw\", mostly unfiltered, depth image ([Frame.acquireRawDepthImage16Bits()](/ar/reference/java/com/google/ar/core/Frame#acquireRawDepthImage16Bits())) and depth confidence image ([Frame.acquireRawDepthConfidenceImage()](/ar/reference/java/com/google/ar/core/Frame#acquireRawDepthConfidenceImage())).\n\nThe raw depth image is sparse and does not provide valid depth for all pixels. Pixels\nwithout a valid depth estimate have a pixel value of 0.\n\nRaw depth data is also available when [AUTOMATIC](/ar/reference/java/com/google/ar/core/Config.DepthMode#AUTOMATIC) is selected.\n\nRaw depth is intended to be used in cases that involve understanding of the geometry in\nthe environment."]]