Using ARKit to capture high quality photos

六月ゝ 毕业季﹏ 提交于 2019-12-10 22:28:03

问题


I am interested in using ARKit's ability to track the phone's position to automatically take photos using the camera. My initial investigation led to me to understand that while ARKit is using the camera, it is not possible to get high-quality images using the standard AVFoundation methods (due to the camera being in use).

I understand I can use sceneView.snapshot(), but the best quality this can provide is 1080p, which isn't high enough quality to use for my application.

My question is, are there any other methods for capturing a high-quality photo from the back-facing camera while an ARSession is running? If not, are there any alternatives to ARKit for estimating the position of the phone?


回答1:


This probably won't get you the resolution you're looking for, but I have noticed that using the currentFrame.capturedImage property on the ARSession yields a higher resolution image than sceneView.snapshot().

Here's an example using the debugger on my iPhone 7:

(lldb) po sceneView.snapshot()
<UIImage: 0x282331180>, {750, 1334}

(lldb) po UIImage(pixelBuffer: session.currentFrame.capturedImage)
▿ Optional<UIImage>
  - some : <UIImage: 0x282331e30>, {1920, 1440}

The resolution will probably vary based on your hardware.

Another thing to check is if you're overriding the videoFormat property of your ARConfiguration. You can check which video formats are supported for your device with ARWorldTrackingConfiguration.supportedVideoFormats.



来源:https://stackoverflow.com/questions/53287693/using-arkit-to-capture-high-quality-photos

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