1. A method of automatically focusing a projector in a projection system, the method comprising: projecting, by the projector, a binary pattern on a projection surface; capturing an image of the projected binary pattern by a camera synchronized with the projector; computing a depth map from the captured image; and adjusting focus of the projector based on the computed depth map.