Saturday, December 2, 2017

3D Photos - Reversing Rapids in Saint-John, New Brunswick

Stereo pair taken with an HTC evo 3d phone. Size is 1887x1060 after auto-aligning in Stereo Photo Maker. I like to use the auto-alignment feature in Stereo Photo Maker and then click "Make an animation gif" to see if the wiggle/wobble that I intend to create via a depth map is gonna look good. Even though the stereo pair has been aligned in Stereo Photo Maker, I still rectify it with ER9b or ER9c.

Left image of stereo pair after rectification with ER9b.

Right image of stereo pair after rectification with ER9b.

Here is part of the output from ER9b:

Mean vertical disparity error = 0.457357
Min disp = -75 Max disp = 19
Min disp = -55 Max disp = 23

I am gonna use the rectified images to get a good depth map in a two-step process. ER9b gives me the min and max disparities in the 2nd of the 2 lines that give the min and max disparities (-55 and 23).

Step 1: Let's get a quick and dirty depth map using DMAG5b, a very rudimentary (but fast) depth map generator!

Depth map obtained with DMAG5b.

This is what I used for DMAG5b:

min disparity for image 1 = -55
max disparity for image 1 = 23
radius = 4
alpha = 0.9
truncation (color) = 30
truncation (gradient) = 10
disparity tolerance = 0
radius to smooth occlusions = 9
sigma_space = 9
sigma_color = 25.5

Because I am gonna use DMAG9b to improve the depth map quality, it's totally ok to use DMAG5b and it's totally ok to use it with a small radius like I did. Yes, there is quite a bit of noise but it really does not matter at this stage.

Occlusion map obtained with DMAG5b.

I am showing the corresponding occlusion map to give an idea of the quality of the depth map. Black means that the disparity in the depth map is probably not correct. Yes, there is quite a bit of black but no worries as DMAG9b will clean all that up nicely.

Step 2: Let's improve this noisy depth map with DMAG9b!

Depth map improved by DMAG9b.

Parameters I used in DMAG9b:

sample_rate_spatial = 16
sample_rate_range = 8
lambda = 0.25
hash_table_size = 100000
nbr of iterations (linear solver) = 25
sigma_gm = 1
nbr of iterations (irls) = 32
radius (confidence map) = 12
gamma proximity (confidence map) = 12
gamma color similarity (confidence map) = 12
sigma (confidence map) = 32

I think this is a drastic improvement. DMAG9b is very good at improving depth maps, no matter where they come from.

Confidence map as computed by DMAG9b.

The confidence map is computed by DMAG9b in the beginning of the computation. It shows the confidence in the disparities/depths in the input depth map (the one produced by DMAG5b) that DMAG9b has. The blacker the value, the less confidence DMAG9b will have in corresponding disparity/depth.

3d wiggle/wobble created by wigglemaker.