如何在 ARKit 中检测垂直平面? [英] How to detect vertical planes in ARKit?

查看:29
本文介绍了如何在 ARKit 中检测垂直平面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何实现垂直平面检测(即墙壁)?

How is it possible to implement a vertical plane detection (i.e. for walls)?

let configuration = ARWorldTrackingSessionConfiguration()
configuration.planeDetection = .horizontal //TODO

推荐答案

现在从 ARKit 1.5 (iOS 11.3) 开始支持.只需使用 .vertical.出于历史目的,我保留了之前的帖子.

This is now supported as of ARKit 1.5 (iOS 11.3). Simply use .vertical. I have kept the previous post below for historical purposes.

垂直平面检测(还)不是 ARKit 中存在的功能..horizo​​ntal 表明此功能可能正在开发中并可能在未来添加.如果它只是一个布尔值,这将表明它是最终的.

Vertical plane detection is not (yet) a feature that exists in ARKit. The .horizontal suggests that this feature could be being worked on and might be added in the future. If it was just a Boolean value, this would suggest that it is final.

我在 WWDC17 上与 Apple 工程师的谈话证实了这种怀疑.

This suspicion was confirmed by a conversation that I had with an Apple engineer at WWDC17.

您可能会争辩说,为此创建一个实现会很困难,因为垂直平面而不是水平平面有无限多的方向,但正如 rodamn 所说,情况可能并非如此.

You could argue that creating an implementation for this would be difficult as there are infinitely many more orientations for a vertical plane rather than a horizontal one, but as rodamn said, this is probably not the case.

来自 rodamn 的 评论:最简单地,一个平面被定义为三个共面的点.一旦沿表面(垂直、水平或任意角度)检测到足够多的共面特征,您就有了表面候选者.只是水平线的法线将沿着上/下轴,而垂直线的法线将平行于地平面.挑战在于未经装饰的石膏板往往会产生很少的视觉特征,而普通的墙壁可能经常不被发现.我强烈怀疑这就是 .vertical 功能尚未发布的原因.

From rodamn’s comment: At its simplest, a plane is defined to be three coplanar points. You have a surface candidate once there are sufficient detected coplanar features detected along a surface (vertical, horizontal, or at any arbitrary angle). It's just that the normal for horizontals will be along the up/down axis, while vertical's normals will be parallel to the ground plane. The challenge is that unadorned drywall tends to generate few visual features, and plain walls may often go undetected. I strongly suspect that this is why the .vertical feature is not yet released.

然而,对此有一个相反的论点.有关详细信息,请参阅 rickster 的评论.

However, there is a counter argument to this. See comments from rickster for more information.

这篇关于如何在 ARKit 中检测垂直平面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆