1. A method for depth mapping, comprising: projecting a pattern of optical radiation onto an object; capturing a first image of the pattern on the object using a first image sensor, and processing the first image alone to generate pattern-based depth data with respect to the object; capturing a second image of the object using a second image sensor, wherein the projected pattern does not appear in the second image, and processing the second image together with the first image to generate stereoscopic depth data with respect to the object; and combining the pattern-based depth data with the stereoscopic depth data to create a depth map of the object, wherein combining the pattern-based depth data with the stereoscopic depth data comprises computing respective measures of confidence associated with the pattern-based depth data and stereoscopic depth data, and selecting depth coordinates from among the pattern-based and stereoscopic depth data responsively to the respective measures of confidence.