How to save a point cloud in the sample code "Capturing depth using the LiDAR camera" with the photoOutput

Hello dear community,

I have the sample code from Apple “CapturingDepthUsingLiDAR” to access the LiDAR on my iPhone 12 Pro. My goal is to use the “photo output” function to generate a point cloud from a single image and then save it as a ply file. So far I have tested different approaches to create a .ply file from the depthmap, the intrinsic camera data and the rgba values. Unfortunately, I have had no success so far and the result has always been an incorrect point cloud.

My question now is whether there are already approaches to this and whether anyone has any experience with it.

Thank you very much in advance!!!

Answered by DTS Engineer in 819893022

Hello @heikooooo,

There is no API that will directly export the capture as a point cloud model, please file an enhancement request using Feedback Assistant.

That being said, you could utilize either Model I/O or SceneKit to construct a scene using the points in your point cloud, and then export that scene using either https://developer.apple.com/documentation/scenekit/scnscene/write(to:options:delegate:progresshandler:) or https://developer.apple.com/documentation/modelio/mdlasset/export(to:)

-- Greg

Hello @heikooooo,

There is no API that will directly export the capture as a point cloud model, please file an enhancement request using Feedback Assistant.

That being said, you could utilize either Model I/O or SceneKit to construct a scene using the points in your point cloud, and then export that scene using either https://developer.apple.com/documentation/scenekit/scnscene/write(to:options:delegate:progresshandler:) or https://developer.apple.com/documentation/modelio/mdlasset/export(to:)

-- Greg

This may be helpful.

ARKit Point Cloud Recorder.

How to save a point cloud in the sample code "Capturing depth using the LiDAR camera" with the photoOutput
 
 
Q