AVCaptureVideoPreviewLayer and ARKit: can they be used together?

I found that using AVCaptureVideoPreviewLayercamera overlays , the quality of the displayed camera image is much better than when using ARSKView. I need to use ARKitand display some SKNodesaccording to the output of the camera, so I assume that using ARSKViewand starting its session is mandatory. On the other hand, it seems that for AVCaptureVideoPreviewLayeryou need to establish a session AVCaptureSession.

Is it possible to get the camera out of AVCaptureVideoPreviewLayerand still be able to display the AR elements with ARKit? Otherwise, is there a way to improve the output quality of the camera when used ARSKView? I have a connected session configured as follows:

if ARWorldTrackingConfiguration.isSupported {
  let configuration = ARWorldTrackingConfiguration()
  skView.session.run(configuration)
}
+4
source share

Source: https://habr.com/ru/post/1685413/


All Articles