If the side-by-side stereo pairs below are too far apart for you to fuse them by parallel viewing, you may be able to zoom out of this web page in your browser. In Chrome, use .
This flowchart shows the files and programs used to convert a 2D image to 3D. The naming convention for the files produced is:-
LPX.D | LeiaPix Converter → depth map |
LPX.LR | LeiaPix Converter → Left and Right images side-by-side |
LPX.LIF | LeiaPix Converter → Leia Image Format file |
LF2.D | LIF2 → depth map |
LF2.M | LIF2 → mono image |
LF2.C | LIF2 → contour map |
LF2.MD | LIF2 → mono image and depth map side-by-side |
SPM.LR | StereoPhoto Maker → Left and Right images side-by-side |
Of course, all of these depth maps are really disparity maps: the actual depth or object distance is inversely proportional to the disparity. In the depth maps, the values are normalised to the range 0 to 255. These values are still referred to here as depths to distinguish them from the disparities used by StereoPhoto Maker in Edit->Depth map-> Create 3D image from 2D+Depth map. SPM calculates the disparities with parameters supplied in this dialog:-
Shifting pixels to the left and right usually leaves gaps in the left and right images, which SPM must fill with its gap-filling algorithm. To appreciate how the gaps occur we can examine the depth map contours superimposed on an image.
The strip underneath the cross-section shows the trajectory of pixels when they are shifted left for the right image. Only pixels at depth changes are shown. When there is a black band at the left edge of an object, pixels are overlaid by compression in the left shift, as can be seen at the edge of the sleeve on the left. When there is a black band at the right edge of an object, pixels are separated by expansion in the left shift, as can be seen at the edge of the arm on the right.
This makes it easier for the gap-filling algorithm than a sudden disparity change, but causes some distortion. This is one reason why the black bands are offset from the edges of objects. The other reason is that objects are often surrounded by protrusions which are below the resolution of the depth map. The classic example is hair around a head. On the stereo images, this offset results in some of the background being pulled in around the object. This is not noticeable when the background is plain, as in the wall behind the figure.
When the background is not plain, parts of it are distorted by being pulled in the direction of the object, as shown below behind the sleeve.
It is instructive to compare the depth map contours from a LeiaPix depth map with those from a depth map extracted by SPM from an iPhone photo taken in portrait mode.
Here there is not much gap between the black bands and the edges of the face and hair. This result in severe compression/expansion artefacts along these edges.
Christopher B. Jones 2022-04-28