Improve discontinuity detection
Use colour gradient in discontinuity test to adjust the sensitivity to depth edges. Higher colour gradients are likely to have discontinuities, so be more sensitive to smaller distance differences?
Perhaps there are other options, like detecting the difference between noise and edges, or by using the normal to estimate where the depth point is expected to be and then measuring distance from expected location.
Edited by Nicolas Pope