PointCloud

public class PointCloud

Contains a set of observed 3D points and confidence values. This class implements Closeable and usually should be used in a Java try-with-resources or Kotlin use block, 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.
 }
 

Public Methods

void
close()
Release PointCloud's resources back to ARCore.
IntBuffer
getIds()
Retrieves a buffer of point cloud point IDs.
FloatBuffer
getPoints()
Returns a buffer of point coordinates and confidence values.
long
getTimestamp()
Returns the timestamp in nanoseconds when this point cloud was observed.
void
release()
Release PointCloud's resources back to ARCore.

Inherited Methods

Public Methods

close

public void close()

Release PointCloud's resources back to ARCore. Calls release().

getIds

public IntBuffer getIds()

Retrieves a buffer of point cloud point IDs.

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.

getPoints

public FloatBuffer getPoints()

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 in ImageFormat.DEPTH_POINT_CLOUD.

Point locations are in the world coordinate space, consistent with the camera position for the frame that provided the point cloud.

getTimestamp

public long getTimestamp()

Returns the timestamp in nanoseconds when this point cloud was observed. This timestamp uses the same time base as Frame.getTimestamp().

Details
See Also

release

public void release()

Release PointCloud's resources back to ARCore. If too many point clouds are held, additional calls to Frame.acquirePointCloud() will fail. Calling this method may invalidate any buffer previously returned by getPoints() or getIds().

This method will be called automatically by close() if the object is acquired in a Java try-with-resources initializer or Kotlin use statement.

Details
See Also