Stay organized with collectionsSave and categorize content based on your preferences.
public classPointCloud
Contains a set of observed 3D points and confidence values. This class implementsCloseableand usually should be used in a Java try-with-resources or Kotlinuseblock,
for example:
Frame frame = session.update();
...
// Automatically releases point cloud resources at end of try block.
try (PointCloud pointCloud = frame.acquirePointCloud()) {
// Access point cloud data.
}
Each point has a unique identifier (within a session) that is persistent across frames. That
is, if a point from point cloud 1 has the same id as the point from point cloud 2, then it
represents the same point in space.
Returns a buffer of point coordinates and confidence values.
Each point is represented by four consecutive values in the buffer; first the X, Y, Z
position coordinates, followed by a confidence value. This is the same format as described inImageFormat.DEPTH_POINT_CLOUD.
Point locations are in the world coordinate space, consistent with the camera position for
the frame that provided the point cloud.
public
long
getTimestamp
()
getTimestamp
publiclonggetTimestamp()
Returns the timestamp in nanoseconds when this point cloud was observed. This timestamp uses
the same time base asFrame.getTimestamp().
Release PointCloud's resources back to ARCore. If too many point clouds are held, additional
calls toFrame.acquirePointCloud()will fail. Calling this method may invalidate any
buffer previously returned bygetPoints()orgetIds().
This method will be called automatically byclose()if the object is acquired in a
Java try-with-resources initializer or Kotlinusestatement.
[[["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\u003eThe \u003ccode\u003ePointCloud\u003c/code\u003e class in ARCore stores a set of 3D points with confidence values, representing the observed environment.\u003c/p\u003e\n"],["\u003cp\u003eIt provides access to point coordinates, IDs, and timestamps for analysis and visualization.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePointCloud\u003c/code\u003e resources should be managed using try-with-resources or Kotlin's \u003ccode\u003euse\u003c/code\u003e to ensure proper release.\u003c/p\u003e\n"],["\u003cp\u003ePoints are represented in world coordinates, aligning with the camera's position during observation.\u003c/p\u003e\n"],["\u003cp\u003eEach point has a persistent unique identifier within a session, allowing tracking across frames.\u003c/p\u003e\n"]]],[],null,["# PointCloud\n\n`\npublic class\n`**PointCloud**`\n` \nContains a set of observed 3D points and confidence values. This class implements [Closeable](https://developer.android.com/reference/java/io/Closeable) and usually should be used in a Java try-with-resources or Kotlin `use` block,\nfor example: \n\n Frame frame = session.update();\n ...\n // Automatically releases point cloud resources at end of try block.\n try (PointCloud pointCloud = frame.acquirePointCloud()) {\n // Access point cloud data.\n }\n \n\u003cbr /\u003e\n\nPublic Methods\n--------------\n\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` void ` | [close](/ar/reference/java/com/google/ar/core/PointCloud#close())`()` Release PointCloud's resources back to ARCore. |\n| ` `[IntBuffer](https://developer.android.com/reference/java/nio/IntBuffer)` ` | [getIds](/ar/reference/java/com/google/ar/core/PointCloud#getIds())`()` Retrieves a buffer of point cloud point IDs. |\n| ` `[FloatBuffer](https://developer.android.com/reference/java/nio/FloatBuffer)` ` | [getPoints](/ar/reference/java/com/google/ar/core/PointCloud#getPoints())`()` Returns a buffer of point coordinates and confidence values. |\n| ` long ` | [getTimestamp](/ar/reference/java/com/google/ar/core/PointCloud#getTimestamp())`()` Returns the timestamp in nanoseconds when this point cloud was observed. |\n| ` void ` | [release](/ar/reference/java/com/google/ar/core/PointCloud#release())`()` Release PointCloud's resources back to ARCore. |\n\nInherited Methods\n-----------------\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.io.Closeable` \n\n|-------------------|-----------|\n| ` abstract void ` | close`()` |\n\nFrom `interface\njava.lang.AutoCloseable` \n\n|-------------------|-----------|\n| ` abstract void ` | close`()` |\n\nPublic Methods\n--------------\n\n#### public\nvoid\nclose\n()\n\n### close\n\n```java\npublic void close()\n``` \nRelease PointCloud's resources back to ARCore. Calls [release()](/ar/reference/java/com/google/ar/core/PointCloud#release()).\n\n#### public\n[IntBuffer](https://developer.android.com/reference/java/nio/IntBuffer)\ngetIds\n()\n\n### getIds\n\n```java\npublic IntBuffer getIds()\n``` \nRetrieves a buffer of point cloud point IDs.\n\nEach point has a unique identifier (within a session) that is persistent across frames. That\nis, if a point from point cloud 1 has the same id as the point from point cloud 2, then it\nrepresents the same point in space.\n\n#### public\n[FloatBuffer](https://developer.android.com/reference/java/nio/FloatBuffer)\ngetPoints\n()\n\n### getPoints\n\n```java\npublic FloatBuffer getPoints()\n``` \nReturns a buffer of point coordinates and confidence values.\n\nEach point is represented by four consecutive values in the buffer; first the X, Y, Z\nposition coordinates, followed by a confidence value. This is the same format as described in\n[ImageFormat.DEPTH_POINT_CLOUD](https://developer.android.com/reference/android/graphics/ImageFormat#DEPTH_POINT_CLOUD).\n\nPoint locations are in the world coordinate space, consistent with the camera position for\nthe frame that provided the point cloud.\n\n#### public\nlong\ngetTimestamp\n()\n\n### getTimestamp\n\n```java\npublic long getTimestamp()\n``` \nReturns the timestamp in nanoseconds when this point cloud was observed. This timestamp uses\nthe same time base as [Frame.getTimestamp()](/ar/reference/java/com/google/ar/core/Frame#getTimestamp()).\n\n| Details ||\n| See Also | - [Frame.getTimestamp()](/ar/reference/java/com/google/ar/core/Frame#getTimestamp()) |\n|----------|--------------------------------------------------------------------------------------|\n\n#### public\nvoid\nrelease\n()\n\n### release\n\n```java\npublic void release()\n``` \nRelease PointCloud's resources back to ARCore. If too many point clouds are held, additional\ncalls to [Frame.acquirePointCloud()](/ar/reference/java/com/google/ar/core/Frame#acquirePointCloud()) will fail. Calling this method may invalidate any\nbuffer previously returned by [getPoints()](/ar/reference/java/com/google/ar/core/PointCloud#getPoints()) or [getIds()](/ar/reference/java/com/google/ar/core/PointCloud#getIds()).\n\nThis method will be called automatically by [close()](/ar/reference/java/com/google/ar/core/PointCloud#close()) if the object is acquired in a\nJava try-with-resources initializer or Kotlin `use` statement.\n\n| Details ||\n| See Also | - [Frame.acquirePointCloud()](/ar/reference/java/com/google/ar/core/Frame#acquirePointCloud()) |\n|----------|------------------------------------------------------------------------------------------------|"]]