Ballistic and diffuse light detection in confocal and heterodyne imaging systems