Monday, December 29, 2014

3D Photos - Nathaniel Bowditch

I would like, in this post, to pit Depth Map Automatic Generator 5 (DMAG5) against Depth Map Automatic Generator 3 (DMAG3).


Left image of Nathaniel Bowditch's tomb in Mount Auburn cemetery.


Right image of Nathaniel Bowditch's tomb in Mount Auburn cemetery.

The stereo pair was taken with my Fuji W3. I resized it in StereoPhoto Maker (without resampling, this time) and aligned it in StereoPhoto Maker as well.

Alright, let's get started and run DMAG5 focusing first on the window radius parameter.


Depth map obtained by DMAG5 with window radius = 12.


Occlusion map obtained by DMAG5 with window radius = 12.


Depth map obtained by DMAG5 with window radius = 24.


Occlusion map obtained by DMAG5 with window radius = 24.

Recall that the occlusion map shows in black the pixels for which the computed disparity is wrong (mismatch between the left and right disparity maps). With window radius = 24, there are fewer wrong disparities in the background but there are more errors at object boundaries (between statue and background). One can safely say that increasing the window radius is a good thing until the object boundaries become too blurry (depth map becomes too smooth).

I guess I could tinker with DMAG5's other parameters but I don't think it's gonna make a tremendous difference, so I'll just stop here as far as DMAG5 is concerned.


Animation gif created using the depth map obtained by DMAG5 with radius = 12 (thanks to depthy.me).

On to DMAG3 which as you probably recall is a graph cuts type of depth map generator. The parameters to play around with are lambda (smoothing parameter) and K (occlusion parameter). In general, if the occlusion map shows a whole lot of black pixels, it's a good idea to increase K. Also, if the depth map shows a lot of noise, it's generally a good idea to increase lambda.


Depth map obtained by DMAG3 with lambda = 10 and K = 30.


Occlusion map obtained by DMAG3 with lambda = 10 and K = 30.

Alright, right off the bat, it would make sense to increase K to make the occlusion map less dark. Let's bump K from 30 to 50.


Depth map obtained by DMAG3 with lambda = 10 and K = 50.


Occlusion map obtained by DMAG3 with lambda = 10 and K = 50.

Hmm, the depth is kinda noisy in the background, so it would be good to increase the smoothing parameter lambda, say from 10 to 40.


Depth map obtained by DMAG3 with lambda = 40 and K = 50.


Occlusion map obtained by DMAG3 with lambda = 40 and K = 50.

Yeah, I guess it might be a good idea at this point to increase K and keep playing with the parameters, but I am gonna stop right here but you get the idea, I'm sure.


Animation gif created using the depth map obtained by DMAG3 with lambda = 40 and K = 50 (thanks to depthy.me).

Obviously, we have a bit of a problem here because the background in the depth map is a tad too noisy to make a good wiggle. One option to remedy this problem is to smooth the disparities with Edge Preserving Smoothing 5 (EPS5), which is what we're gonna do.


Depth map obtained by DMAG3 with lambda = 40 and K = 50 and then smoothed with EPS5.


Animation gif created using the depth map obtained by DMAG3 with lambda = 40 and K = 50 and then smoothed by EPS5 (thanks to depthy.me).

I am not sure what kind of conclusion can be drawn here, especially with only one test case but it seems to me that a local stereo matching method like DMAG5 which is a weight based window type stereo matching method can outperform (in many ways) a global method like DMAG3 which is a global stereo matching method relying on graph cuts. I know this goes against the academic grain a bit as global methods have kinda been put on a pedestal in the literature for years now, but in practice, one has to recognize that the simpler window-based local methods, if done right, are more than adequate to produce depth maps for making 3d wiggles and lenticulars.