【问题标题】:Can you extract the estimatedDepthData and segmentationBuffer when using people occlusion in ARKit在ARKit中使用人物遮挡时可以提取estimatedDepthData和segmentationBuffer吗
【发布时间】:2020-09-23 23:34:39
【问题描述】:

有没有人成功地从 ARKit 应用程序中提取了估计的深度数据和分段缓冲区?我正在尝试识别人与渲染资产之间的任何碰撞。由于在运行时已经存在分割蒙版和深度蒙版,因为人们遮挡已开启,我想知道是否可以获取该数组并使用它来识别碰撞事件。

我做了一些研究,似乎我可能需要设置一个自定义渲染器来处理这个问题,但我想知道是否有其他人想出了一个更简单的方法。我正在使用一个非常简单的配置。

    let configuration = ARWorldTrackingConfiguration()
    configuration.planeDetection = .horizontal
    configuration.frameSemantics.insert(.personSegmentationWithDepth)
    // Run the view's session
    sceneView.session.run(configuration)

【问题讨论】:

    标签: ios arkit image-segmentation


    【解决方案1】:

    可以通过ARFrame 的属性访问分段和深度数据。您需要确认ARSessionDelegate 协议才能获得更新。

    func session(_ session: ARSession, didUpdate frame: ARFrame) {
       if let segmentationData = frame.segmentationBuffer {
           // Do smth with segmentation data
       }
       if let depthData = frame.estimatedDepthData {
           // Do smth with depth data
       } 
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-04
      • 2019-12-07
      • 2021-11-04
      • 2022-01-24
      • 2018-01-28
      • 2015-05-06
      • 2014-10-06
      • 1970-01-01
      相关资源
      最近更新 更多