如何解决如何从 Xamarin.iOS 中的 SceneDepth 数据获取距离?
我将在 Xamarin.iOS 中访问 ARDepthData
。到目前为止,我的代码是这样的。
public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
if (!ARWorldTrackingConfiguration.SupportsFrameSemantics(ARFrameSemantics.SceneDepth))
{
UIAlertController alertController = UIAlertController.Create("Unsupported Device","SceneDepth is not available on current device",UIAlertControllerStyle.Alert);
alertController.AddAction(UIAlertAction.Create("OK",UIAlertActionStyle.Default,null));
PresentViewController(alertController,true,null);
}
else
{
UIAlertController alertController = UIAlertController.Create("Yay","Congratulations! Your device supports SceneDepth",null);
configuration = new ARWorldTrackingConfiguration
{
FrameSemantics = ARFrameSemantics.SceneDepth,PlaneDetection = ARPlaneDetection.None
};
sceneView.Session.Delegate = new SessionDelegate();
sceneView.Session = session;
sceneView.Session.Run(configuration);
}
我的SessionDelegate
班是这样的。
public class SessionDelegate : ARSessionDelegate
{
public SessionDelegate()
{
}
public override void DidUpdateFrame(ARSession session,ARFrame frame)
{
base.DidUpdateFrame(session,frame);
Console.WriteLine("Frame has been updated");
if (frame.SceneDepth != null)
{
Console.WriteLine("Depth data is not null");
}
}
}
我的应用程序只是打开了相机视图。上面的委托没有触发。我在这里缺少什么?这个代表什么时候开火,我怎样才能得到距离 场景深度数据?
谢谢!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。