1. A method for depth mapping, comprising: receiving in a digital processor an image of a pattern of spots that has been projected onto a scene, which includes a feature having a width that is less than twice an average distance between the spots in the pattern that is projected onto the feature; processing the image so as to find a 3D location of the feature by computing three-dimensional (3D) coordinates of points on the feature based on transverse shifts of the spots in the image; and connecting the spots appearing on the feature in the 3D location in order to find depth coordinates of the points on the feature with a resolution finer than a depth increment corresponding to a transverse shift equal to the average distance between the spots in the image.