# Depth Smoothing

• ### General discussion

• Playing around with the depth I found it works best to view it like a tape measure. Your measurement is to the nearest marking on that tape measure. The spacing between markings vary by distance. At 2m those are about 1cm apart, but at 1m they're about 0.25cm apart and at 4m about 4cm apart. Between 0.8m and 4m there's only about 345 markings on that tape measure and they get further and further apart. I've only played with the center so I don't know how that varies by the distance from the center, but that's how it is at the center.

The accuracy is the spacing between those marks. It's roughly 1cm*(d/2m)^2 where d is the depth in meters. At the center I get depth changes of about 3mm at 1m, 11.5mm at 2m and about 45mm at 4m. Across the range I get an average of about 1.159cm, max of 1.397cm and min of 0.901cm at 2m using the actual step sizes. It accurate to say it's within 1cm since the actual distance will be within half of that of the given distance. The differance in distance between two objects can be more than 1cm at 2m with both being measured at the same distance.

What you get is, effectively, layer upon layer of flat surfaces. So with a centered sphere it's likely have flat discs of decreasing radius stacked up. Due to how the accuracy varies those discs get thinner and thinner the closer you get. The depth changes you pass halfway from two distinct depths. If you think about that representation of a sphere it isn't a very good representation of a sphere. If you connect the center points of the edges of those discs it would be a much better representation of a sphere. That would look more what you would generate as a mesh representing a sphere.

That led me to the thought of smoothing depths. I scan the image horizontally looking for three transitions in depth that are each within the accuracy of the next. I assume the left edge is actually halfway between the the depth of the first and second run and the right edge halfway between the second and third run. I then linearly interpolate the second run between those two edges. I then repeat that vertically and average the two together.

The biggest problem though is the jitter. With a static scene the pixels at which the transitions occur oscillates. The center of regions of a given depth are stable, the edges are not. You have a 3mm resolution in the xy at 2m. So if the point the transition takes place varies across three pixels there's 1cm. So it may not be any more accurate, but it at least does look like a more realistic surface. It makes little differance in the visual of the depth, but might make a big differance in the appearance of a mesh built off the point cloud.

Saturday, July 23, 2011 1:01 AM