A system for object reconstruction includes an illuminating unit, comprising a light source and a generator of a non-periodic pattern. A diffractive optical element (DOE) is disposed in an optical path of illuminating light propagating from the illuminating unit toward an object, thereby projecting the non-periodic pattern onto an object. An imaging unit detects a light response of an illuminated region and generating image data indicative of the object within the projected pattern. A processor reconstructs a three-dimensional (3D) map of the object responsively to a shift of the pattern in the image data relative to a reference image of the pattern.