简体   繁体   English

ARKIT-如何确定ARKit已校准?

[英]ARKIT - How can I make sure ARKit is calibrated?

I am making a simple ruler ARKit app in swift 4. 我正在用Swift 4制作一个简单的标尺ARKit应用程序。

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. 我认为,这可能是由于ARkit校准不良而无法正确检测我的表面所致。

I currently project 4 points in 3D, and want to make sure the measure I get with them is correct, or at least coherent . 我目前以3D投影4个点,并希望确保对它们的测量是正确的,或者至少是连贯的 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. 一旦完成,我至少知道AR已经过校准。

I found a decent way of doing this, by having a threshold on the number of FeaturePoints detected in my frame by Arkit. 通过对Arkit在我的框架中检测到的FeaturePoints设置阈值,我找到了一种不错的方法。

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. 例如,如果frame.rawFeaturePoints?.points.count返回的值比我的阈值高(我个人使用50,但这主要取决于您通常距目标的距离),则我的应用程序经过了校准。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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