Z-Depth Map — Expanding EXIF Data for More Powerful Post-Processing

By JAWAD RIACHI

I’ve recently downloaded DxO Optics Pro (demo version) just for the sake of experimenting with the software on some photos I shot with a small Micro Four Thirds camera. The camera I used had a fairly sharp wide angle lens (14mm F2.5). When I uploaded the photos into the software, DxO Optics Pro analyzed the photos, connected to the Internet and downloaded the profile of the lens without any interference from my end! I have to admit that this was impressive. It is not rocket science, but it was impressive to see a piece of software taking advantage of the EXIF data in the photos and working accordingly. I did not have to specify anything! It just worked.

Having a background in software engineering, I decided to closely examine the EXIF data structure and learn more about it beyond the usual shutter speed, aperture, ISO and focal length. It turns out that the data is fairly extensive…

Later on, I landed on a Samsung NX300 2D|3D camera which I had heard about but never had a chance to play with. Not being a fan of 3D images, I usually don’t pay too much attention to these types of cameras and I believe many photographers feel the same way I do. 3D cameras have struggled in finding support between photographers. On the other hand this one grabbed my attention because it looked like a regular camera except for a 3D | 2D button on the lens.

It turns out that this lens has two built-in shutters which are activated when shooting in 3D mode. These shutters slightly change the perspective of the captured image in order to create a stereoscopic photograph (using parallax). It was not perfect but it was enough to create sense of depth.

The closer the objects to the lens the lighter they are, and the farther the darker they get. As per the current EXIF specs, there is no concept of depth. Most image manipulation software deal with photos as flat 2D matrices of RGB values. | cgarena.com
The closer the objects to the lens the lighter they are, and the farther the darker they get. As per the current EXIF specs, there is no concept of depth. Most image manipulation software deal with photos as flat 2D matrices of RGB values. | cgarena.com
At first this may not seem to have anything to do with EXIF data. But… what if rather than shooting 3D images, the photographer shoots normal photos and a “Z-map” (or Z-depth map) is created along with the shot and stored in the EXIF data in a form of a BLOb (Binary Large Object).

This means that for every shot the camera will take three. The first is the original shot and the remaining two are used to create the Z-map.

A Z-map is a grayscale image representing the depth of the objects within the frame. White is close to the lens and black is infinity.

Having such data in the EXIF segment is invaluable during post-processing. Photo manipulation software see the photos as flat 2D matrices of RGB values. A Z-map will provide a Z-coordinate for every pixel in the matrix.

Such data is not generated at the moment and software like Photoshop try to make a guess at it. The spot healing tool in Photoshop works by examining the neighboring pixels to cover the spot. If the spot is on the edge of an object, Photoshop grabs the wrong pixels and the end result is worse than having a spot.

That's how the camera would see a Z-mapped room for more powerful and flexible post-processing. | en.9jcg.com
That’s how the camera would see a Z-mapped room for more powerful and flexible post-processing. | en.9jcg.com
Had the Z-coordinates of the neighboring pixels been available, Photoshop would have been smarter to figure out that these pixels do not belong to the object and would not use them.

A film simulation software can work more efficiently and would produce more accurate results if a Z-map is available since light roll off on film tends to be different than light roll off on a sensor.

A lens blur filter and depth of field simulating what a real camera would see are other examples which relies on Z-maps to work efficiently. A Z-depth map can also be used as a control layer for 3D matte extract, depth matte, 3D fog, ID matte and various other effects.

Due to the fact that the Z-map is derived from two photos shot in sequence with a slight offset of time and perspective, a confidence level of the Z-map should be inserted into the EXIF data in order to be taken under consideration by the manipulation algorithms. This parameter could also be used as an indicator of depth performance of future cameras.

For more on three-dimensional Z-depth maps and related computer graphics visit CGArena.

Jawad Riachi is a freelance consultant in product design and development. He has always been interested in product design and development. It could be software, hardware, digital content (including 3D visualization) or combination of all three. He has passion for photography and is fascinated by the light from the esthetic point of view down to the photons’ level. Jawad believes that the future of environment friendly product design and development lies in the understanding of the phenomenon of light.

Jawad has almost 20 years of experience in software architecture, natural interfaces and knowledge of manufacturing processes. He has consulted for well-known international companies such as HP, Nokia, Lotus Corporation (bought by IBM), Charles Schwab, Visa International, Pacific Bell.