1

I created a view with the two Image Views side-by-side to compare the two.

Left side is from ARFrame.capturedImage.

Right side is from ARSCNView.snapshot()

You can see that the left side is slightly brighter than the right side, even though I pointed the camera at a white wall.

White wall

I need both functions to return the same pixel values for the same object, so that I can later copy over certain pixels without obvious contours showing up due to the difference in brightness.

Is it perhaps due to how I am converting the CVPixelFrameBuffer into UIImage?

Mastergalen
  • 4,289
  • 3
  • 31
  • 35
  • I don’t think the brightness is the problem. Take a closer look at the wrinkles in the bottom they are different pictures. I think the right one is zoomed – sj-r Sep 24 '18 at 02:03
  • @sj-r I've replaced the image with the camera pointed at a white wall. The misalignment in the wrinkles may just have been due to capture lag between the two photos. – Mastergalen Sep 24 '18 at 08:52
  • I believe the reason is because ARKit uses gamma sRGB, whereas SceneKit uses linear sRGB. https://stackoverflow.com/questions/44033605/why-is-metal-shader-gradient-lighter-as-a-scnprogram-applied-to-a-scenekit-node/44045637#44045637 However, there seems to be no fast way to do the conversion without diving into shader code. – Mastergalen Sep 25 '18 at 14:35
  • Nevermind, I implemented the conversion but it's still off :( – Mastergalen Sep 25 '18 at 15:40

0 Answers0