在 ARCore 中检测垂直平面 [英] Detecting vertical planes in ARCore

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

问题描述

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

I was wondering if someone was managed to identify vertical planes ahead of the device in realtime using the ARCore SDK.

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

I was managed to achieve decent result by defining a wall using a line equation:

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

对于每个 y"注释我的意思是我忽略了 y 轴(从上方看墙壁,就像在房间的 2d 映射中一样)以计算定义墙壁的线.

by "for every y" comment I meant that I ignore the y axis(looking at the wall from above as in 2d mapping of a room) in order to calculate a line that defines the wall.

乘数是点之间的旋转:

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
}

现在我在用户走动时触发该计算并对许多点云点进行采样.

Now I trigger that computation while the user is walking around and samples many point cloud's points.

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

The results are good but not as accurate as the horizontal plane detection of the ARCore.

推荐答案

现在是 ARCore 的一部分,在 1.2.0 版 安卓版

Now is part of ARCore, was release on version 1.2.0 for android

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

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