To determine if the depth (coming from the input depth map) at a given pixel is reliable, DMAG11b computes the depth variance using the joint bilateral filter. A low (high) depth variance translates to a high (low, respectively) confidence. The output depth map is generated by making transparent any pixel for which the depth (coming from the input depth map) is of low confidence.
This idea of using the variance of the depth to compute a confidence comes from Jon Barron and his paper entitled "The Fast Bilateral Solver".
Here's an example:
Depth confidence map. White (black) means high (low, respectively) confidence. This depth confidence map is computed internally by DMAG11b.
The windows executable (guaranteed to be virus free) is available for free via the 3D Software Page.