Friday, January 17, 2014

Edge Preserving Smoothing 2 (EPS2)

EPS2 is typically used to smooth/blur/filter disparity maps obtained by any automatic depth map generator that doesn't smooth the disparities on its own, for example, Depth Map Automatic Generator 2 (DMAG2). EPS2 is edge-preserving. The edges that are preserved are not the edges in the disparity map, but the edges of the reference image (typically, the left image in a stereo pair). This means that EPS2 will not fatten the boundaries between adjacent zones that are at different depths in the depth map.

The parameters that control the smoothing are the radius of the convolution window, the spatial proximity parameter (gamma_p), and color similarity parameter (gamma_c). They are the same ones used in DMAG2 and they are explained in Weighted Windows for Stereo Correspondence Search.

The disparity (or intensity, to be more general) at each pixel is replaced by a weighted average of disparity (or intensity, to be more general) values from neighboring pixels. The weights are computed in the exact same way as in Weighted Windows for Stereo Correspondence Search. Clearly, the edges of the reference image are preserved because pixels that are dissimilar in color to the reference pixel (at the center of the convolution window) receive much lower "color similarity" weights than pixels that are similar in color. Also, the further away the neighboring pixel is to the reference pixel, the lower the "spatial proximity" weight. The weight that is used in the convolution is the product of the "color similarity" and "spatial proximity" weights, which kinda combines the two effects for a rather nice edge preserving smoothing behavior. EPS2 behaves a bit like a bilateral filter, an edge preserving filter.

The following pictures show how the edge preserving smoother performs on a depth map obtained by DMAG2 (this is the "teddy" stereo pair from one of the Middlebury stereo data sets):

Left image (reference image for edge preserving smoothing).

Right image.

Disparity map obtained with DMAG2 (input to EPS2).

Smoothed disparity map obtained with EPS2 using radius=12, gamma_p=17, and gamma_c=14.

The windows executable (guaranteed to be virus free) is available for free via the 3D Software Page. Please, refer to the 'Help->About' page in the actual program for how to use it.