Tuesday, November 22, 2016

3D Photos - At the station


This is the original pair (provided by mediavr) after a little bit of downsampling. Image dimension is 1824x1368 pixels.


This is the stereo pair after rectification by er9b. The white borders will be removed later. They have no effect of depth map generation.

Let's get a depth map first using dmag5. Other automatic depth map creators could have been used like dmag2, dmag6, or dmag7, but I kinda like using dmag5. Note this kind of scene is the worst nightmare of any automatic depth map creator because of the presence of areas with low texture (walls/floors are the worst offenders).


This is the (left) depth map generated by dmag5.

Input parameters for dmag5:

image 1 = ../image_l.png
image 2 = ../image_r.png
min disparity for image 1 = -85
max disparity for image 1 = -43
disparity map for image 1 = depthmap_l.jpg
disparity map for image 2 = depthmap_r.jpg
occluded pixel map for image 1 = occmap_l.jpg
occluded pixel map for image 2 = occmap_r.jpg
radius = 32
alpha = 0.9
truncation (color) = 30
truncation (gradient) = 10
epsilon = 255^2*10^-4
disparity tolerance = 0
radius to smooth occlusions = 9
sigma_space = 9
sigma_color = 25.5
downsampling factor = 2

Worth noting is the radius equal to 32 (which is quite large) and the downsampling factor equal to 2 (I used 2 instead of 1 mostly for convenience since it is much faster). I guess I could have recreated the depth map using a downsampling factor of 1 but I did not.

At this point, we have a not so great depth map. What to do to improve things automatically? First option is to use an edge preserving smoother like eps7, eps9, eps2, or eps5.


This is the depth map obtained with eps7. I think we are gonna need something a little bit more drastic. Note that it would have been a good idea to use another edge preserving smoother like eps9, eps2, or eps5 to see if it made a difference. Also, the parameters could have been played with a little.

Input parameters for eps7:

image to filter = ../depthmap_l.jpg
joint image = ../../image_l.png
sigma_s = 1000
sigma_r = 100
num_iterations = 3
filtered image = depthmap_l_eps7.jpg

The other option is to use the more aggressive dmag9b or dmag11b.


This is the depth map generated by dmag9b. Dmag9b is based upon the Fast Bilateral Solver by Jonathan Barron et al.

Input for dmag9b:

reference image = ../../image_l.png
input disparity map = ../depthmap_l.jpg
sample_rate_spatial = 32
sample_rate_range = 8
lambda = 0.25
hash_table_size = 100000
nbr of iterations (linear solver) = 25
sigma_gm = 1.4142
nbr of iterations (irls) = 32
radius (confidence map) = 12
gamma proximity (confidence map) = 12
gamma color similarity (confidence map) = 12
sigma (confidence map) = 0.25
output depth map image = depthmap_l_dmag9b.jpg

Let's see what dmag11b produces to put things in perspective ...


This is the depth map generated by dmag11b. Dmag11b removes depths with low confidence and inpaints the "holes" using a bilateral filter. It is very similar to what dmag4 and dmag11 do when densifying a sparse depth map.

Input for dmag11b:

reference image = ../../image_l.png
input depth map = ../depthmap_l.jpg
output depth map = depthmap_l_dmag11b.jpg
radius (confidence map) = 12
gamma proximity (confidence map) = 12
gamma color similarity (confidence map) = 12
sigma (confidence map) = 0.25
radius (inpainting) = 1
gamma proximity (inpainting) = 10000
gamma color similarity (inpainting) = 1
maximum number iterations (inpainting) = 1000
scale number (inpainting) = 1

Both dmag9b and dmag11b use a depth confidence map to determine whether recorded depths are reliable or not.


This is the depth confidence map used by both dmag9b and dmag11b. The darker the pixel, the less reliable the depth at that pixel is.


This is the 3d animated wiggle gif obtained with wigglemaker using the depth map generated by dmag9b.


This is the 3d animated wiggle gif obtained with wigglemaker using the depth map generated by dmag11b.

No comments:

Post a Comment