Detecting vertical planes in ARCore

℡╲_俬逩灬. 提交于 2019-11-28 20:37:42

问题


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




回答3:


Since ARCore 1.2 was released we can use four values of Config.PlaneFindingMode enumeration.

Here's how a code looks like:

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.

Hope this helps.



来源:https://stackoverflow.com/questions/45977545/detecting-vertical-planes-in-arcore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!