Computational imaging with single-photon detectors