Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting vertical planes in ARCore

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.

like image 888
Nativ Avatar asked Aug 31 '17 09:08

Nativ


People also ask

How does Aircraft AR detection work?

When a plane is detected, the AR Plane Manager instantiates the Plane Prefab to represent the plane. The Plane Prefab can stay null , but the plane manager ensures the instantiated GameObject has an ARPlane component on it. The ARPlane component only contains data about the detected plane.

What is Plane Detection?

AR plane detection, also known as AR plane object breakaway, lets learners place a 3D model of any object onto a tabletop or floor surface in front of them. Once placed, learners can complete any of the following actions: Rotate and resize the object.

How does surface detection help produce AR experiences in ARCore?

Surface detection in ARCore: It looks for clusters of feature points that appear to lie on common horizontal surfaces such as tabletop and desks. It also provides the boundaries of the plane by detecting the edges in the camera images. Developers can utilize these surfaces/planes to place the virtual object. 3.


1 Answers

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 :)

like image 111
Kitwradr Avatar answered Oct 16 '22 14:10

Kitwradr