gpt4 book ai didi

iOS Swift ARKit 可视化 ARWorldMap RawFeaturePoints 中的原始特征点

转载 作者:行者123 更新时间:2023-11-30 10:58:25 38 4
gpt4 key购买 nike

ARWorldMap 具有 rawFeaturePoints,它是 ARPointCloud 类型的点云

有谁知道如何像下面的视频一样可视化这个点云;

https://m.youtube.com/watch?v=Pb4uv4FSWKI

如何实现这一目标?

最佳答案

正如您所说,这可以使用 rawFeaturePoints 实例属性来实现,它代表在相机图像中检测到的显着特征。

var rawFeaturePoints: ARPointCloud? { get }

或者

sceneView.session.currentFrame?.rawFeaturePoints

Here's an extract of CODE written by Josh Robbins on a GitHub.

func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {
guard let currentFrame = self.augmentedRealitySession.currentFrame,
let featurePointsArray = currentFrame.rawFeaturePoints?.points else { return }
visualizeFeaturePointsIn(featurePointsArray)
}

func visualizeFeaturePointsIn(_ featurePointsArray: [vector_float3]) {
self.augmentedRealityView.scene.rootNode.enumerateChildNodes { (featurePoint, _) in
featurePoint.geometry = nil
featurePoint.removeFromParentNode()
}
DispatchQueue.main.async {
self.rawFeaturesLabel.text = self.Feature_Label_Prefix + String(featurePointsArray.count)
}
featurePointsArray.forEach { (pointLocation) in
let clone = sphereNode.clone()
clone.position = SCNVector3(pointLocation.x, pointLocation.y, pointLocation.z)
self.augmentedRealityView.scene.rootNode.addChildNode(clone)
}
}

关于iOS Swift ARKit 可视化 ARWorldMap RawFeaturePoints 中的原始特征点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53681629/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com