Created
July 8, 2020 20:18
-
-
Save MasDennis/09d10166e8adbdb811dd7504ad509bd2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func renderer(_ renderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: TimeInterval) { | |
// Get the capture image (which is a cvPixelBuffer) from the current ARFrame | |
guard let capturedImage = sceneView.session.currentFrame?.capturedImage else { return } | |
let imageRequestHandler = VNImageRequestHandler(cvPixelBuffer: capturedImage, | |
orientation: .leftMirrored, | |
options: [:]) | |
do { | |
try imageRequestHandler.perform([objectDetectionRequest]) | |
} catch { | |
print("Failed to perform image request.") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment