arscnview

Reliable access and modify captured camera frames under SceneKit

六月ゝ 毕业季﹏ 提交于 2019-11-29 08:21:28
I try to add a B&W filter to the camera images of an ARSCNView, then render colored AR objects over it. I'am almost there with the following code added to the beginning of - (void)renderer:(id<SCNSceneRenderer>)aRenderer updateAtTime:(NSTimeInterval)time CVPixelBufferRef bg=self.sceneView.session.currentFrame.capturedImage; if(bg){ char* k1 = CVPixelBufferGetBaseAddressOfPlane(bg, 1); if(k1){ size_t x1 = CVPixelBufferGetWidthOfPlane(bg, 1); size_t y1 = CVPixelBufferGetHeightOfPlane(bg, 1); memset(k1, 128, x1*y1*2); } } This works really fast on mobile, but here's the thing: sometimes a colored

Reliable access and modify captured camera frames under SceneKit

二次信任 提交于 2019-11-28 01:42:58
问题 I try to add a B&W filter to the camera images of an ARSCNView, then render colored AR objects over it. I'am almost there with the following code added to the beginning of - (void)renderer:(id<SCNSceneRenderer>)aRenderer updateAtTime:(NSTimeInterval)time CVPixelBufferRef bg=self.sceneView.session.currentFrame.capturedImage; if(bg){ char* k1 = CVPixelBufferGetBaseAddressOfPlane(bg, 1); if(k1){ size_t x1 = CVPixelBufferGetWidthOfPlane(bg, 1); size_t y1 = CVPixelBufferGetHeightOfPlane(bg, 1);