Detecting vertical planes

2019-02-01 18:41发布

问题:

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)

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.

the Multiplier is the rotation between the points:

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

The all computation is:

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.

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

回答1:

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



回答2:

You can refer to this issue on official Google AR Core github repo https://github.com/google-ar/arcore-unity-sdk/issues/31 . This feature is released in ARCore SDK for unity (v1.2.0) SDK link as mentioned in the issue. Hope this helps :)



标签: arcore