unprojectFromBuffers

open fun unprojectFromBuffers(pixelX: Int, pixelY: Int, yuvData: YuvData, rawDepthData: RawDepthData, intrinsics: CameraIntrinsics, cameraPose: Pose): Vector3

Unprojects a 2D pixel coordinate from the camera image to a 3D world-space coordinate. This "safe" version uses copied byte/short buffers instead of live Image objects, preventing resource holding.

Return

A Vector3 in world space, or null if the depth is invalid (0).

Parameters

pixelX

The x-coordinate in the YUV/Camera image's resolution.

pixelY

The y-coordinate in the YUV/Camera image's resolution.

yuvData

The safe, copied YUV camera image data.

rawDepthData

The safe, copied 16-bit raw depth data.

intrinsics

The camera intrinsics for the depth image.

cameraPose

The ARCore pose of the camera when the image was taken.