A computer-implemented method comprising: pulsing, at a first illuminator of an electronic device , a first illumination pattern into an environment of the electronic device at a first phase and a first frequency; pulsing, at a second illuminator of the electronic device, a second illumination pattern into the environment of the electronic device at a second phase and the first frequency, wherein the second illumination pattern is rotated with respect to the first illumination pattern ; dynamically adjusting the first and second phases; capturing, at a first camera of the electronic device, reflections of the first illumination pattern as a first series of images of the environment at the first phase and the first frequency; capturing, at a second camera of the electronic device, reflections of the second illumination pattern as a second series of images of the environment at the second phase and the first frequency; comparing, at a processor of the electronic device, a first patch of a first image of the first series of images to a second patch of a second image of the second series of images and at least one patch of each of one or more images captured by the first and/or second cameras immediately prior to the first image, wherein each patch comprises a plurality of pixels; computing a cost function for the compared patches; generating a disparity map indicating disparities between corresponding pixels of corresponding patches of the first image and the second image based on the cost function; and refining the disparities of the disparity map to generate an estimated depth map of the environment. pulsing, at a first illuminator of an electronic device , a first illumination pattern into an environment of the electronic device at a first phase and a first frequency; pulsing, at a second illuminator of the electronic device, a second illumination pattern into the environment of the electronic device at a second phase and the first frequency, wherein the second illumination pattern is rotated with respect to the first illumination pattern ; dynamically adjusting the first and second phases; capturing, at a first camera of the electronic device, reflections of the first illumination pattern as a first series of images of the environment at the first phase and the first frequency; capturing, at a second camera of the electronic device, reflections of the second illumination pattern as a second series of images of the environment at the second phase and the first frequency; comparing, at a processor of the electronic device, a first patch of a first image of the first series of images to a second patch of a second image of the second series of images and at least one patch of each of one or more images captured by the first and/or second cameras immediately prior to the first image, wherein each patch comprises a plurality of pixels; computing a cost function for the compared patches; generating a disparity map indicating disparities between corresponding pixels of corresponding patches of the first image and the second image based on the cost function; and refining the disparities of the disparity map to generate an estimated depth map of the environment. <EOS>