简体   繁体   中英

ARKIT - How can I make sure ARKit is calibrated?

I am making a simple ruler ARKit app in swift 4.

But I came across the problem that sometimes, my measures are a bit or completely off. Which, I think, is probably due to ARkit being badly calibrated and not detecting my surface correctly.

I currently project 4 points in 3D, and want to make sure the measure I get with them is correct, or at least coherent . Is there a standard way to do that?

Thanks in advance

Maybe not a standard way but the way I went about it was by performing hit tests every half a second or so until the hit test actually returned something. Once it did, I at least knew the AR had been calibrated.

I found a decent way of doing this, by having a threshold on the number of FeaturePoints detected in my frame by Arkit.

For example, if frame.rawFeaturePoints?.points.count returns something higher than my threshold (I personally use 50, but that mostly depends on the distance you will usually be from your target), I estimate my app is calibrated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM