  In this paper we introduce an efficient method to unwrap multi-frequency
phase estimates for time-of-flight ranging. The algorithm generates multiple
depth hypotheses and uses a spatial kernel density estimate (KDE) to rank them.
The confidence produced by the KDE is also an effective means to detect
outliers. We also introduce a new closed-form expression for phase noise
prediction, that better fits real data. The method is applied to depth decoding
for the Kinect v2 sensor, and compared to the Microsoft Kinect SDK and to the
open source driver libfreenect2. The intended Kinect v2 use case is scenes with
less than 8m range, and for such cases we observe consistent improvements,
while maintaining real-time performance. When extending the depth range to the
maximal value of 8.75m, we get about 52% more valid measurements than
libfreenect2. The effect is that the sensor can now be used in large depth
scenes, where it was previously not a good choice. Code and supplementary
material are available at
http://www.cvl.isy.liu.se/research/datasets/kinect2-dataset.
