【问题标题】:Detecting vertical planes in ARCore在 ARCore 中检测垂直平面
【发布时间】:2018-02-09 04:18:07
【问题描述】:

我想知道是否有人能够使用 ARCore SDK 实时识别设备前方的垂直平面。

通过使用直线方程定义一堵墙,我设法取得了不错的结果:

z = Multiplier * x + Constant (For every y)

“对于每个 y”的评论是指我忽略了 y 轴(从上方看墙壁,就像在房间的 2d 映射中一样),以便计算定义墙壁的线。

乘数是点之间的旋转:

let angleDeg = Float((360 - angle + 360) % 360) * Float.pi / 180.0;

所有的计算是:

let angle: Int = Int((atan2(pointA.z - pointB.z, pointA.x - pointB.x) * 180) / Float.pi) % 360
     yRotation = Float((360 - angle + 360) % 360) * Float.pi / 180.0

    if pointA.x == pointB.x {
         multiplier = Float.infinity
    } else {
         multiplier = (pointA.z - pointB.z) / (pointA.x - pointB.x)
    }
    constant = pointA.z - multiplier * pointA.x
}

现在我在用户四处走动并采样许多点云的点时触发该计算。

结果不错,但不如 ARCore 的水平面检测准确。

【问题讨论】:

  • 有趣。一些示例视频显示了垂直墙壁上的物体,所以我假设它们也被原生检测到。
  • @RatherNotsay 谢谢。我会检查它们并在我进展时更新线程
  • 这方面有什么更新吗?
  • 还没有,我换了几个星期的其他项目。我可能会在 2 周内恢复它。我可以分享的是,iOS 用同样的方法在 ARKit 中实现了它,并且对他们来说效果很好。
  • 最新版本 (ARCore 1.0) 已部分解决此问题。现在您可以将对象放置在垂直表面中(为检测到的点提供法线)。

标签: java kotlin augmented-reality arcore


【解决方案1】:

自从 ARCore 1.2 发布以来,我们可以使用 Config.PlaneFindingMode 枚举的四个值。

代码如下所示:

public static final Config.PlaneFindingMode DISABLED
// Plane detection is disabled.

public static final Config.PlaneFindingMode HORIZONTAL
// Detection of only horizontal planes is enabled.

public static final Config.PlaneFindingMode VERTICAL
// Detection of only vertical planes is enabled.

public static final Config.PlaneFindingMode HORIZONTAL_AND_VERTICAL
// Detection of both horizontal and vertical planes is enabled.

希望这会有所帮助。

【讨论】:

    【解决方案2】:

    现在是 ARCore 的一部分,在 version 1.2.0 上发布用于 android

    【讨论】:

      【解决方案3】:

      您可以在 Google AR Core github repo https://github.com/google-ar/arcore-unity-sdk/issues/31 上参考这个问题。此功能在 ARCore SDK for unity (v1.2.0) SDK link 中发布,如问题中所述。希望这会有所帮助:)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-11-09
        • 2019-06-04
        • 1970-01-01
        • 1970-01-01
        • 2018-02-20
        • 1970-01-01
        相关资源
        最近更新 更多