Detecting vertical planes in ARCore

I was wondering if someone was able to determine the vertical planes in front of the device in real time using the ARCore SDK.

I managed to achieve a decent result by defining a wall using the linear equation:

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

in the β€œfor every y” comment, I meant that I ignore the y axis (looking at the wall from above as a 2d-image of the room) to calculate the line that defines the wall.

A multiplier is a rotation between points:

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

All calculations:

 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 start this calculation while the user walks around and displays a lot of dots.

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

+9
java kotlin augmented-reality arcore
source share
3 answers

Now part of ARCore, was released on version 1.2.0 for Android

0
source share

You can address this issue in the official Google AR Core github repository https://github.com/google-ar/arcore-unity-sdk/issues/31 . This feature was released in the ARCore SDK to reference the Unity (v1.2.0) SDK, as mentioned in the release. Hope this helps :)

+2
source share

Since the release of ARCore 1.2, we can use the four values ​​of the Config.PlaneFindingMode enumeration.

This is what the 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.

0
source share

All Articles