A method for operating a gated camera (5) having a first lighting device (7.1), a second lighting device (7.2) spaced apart from the first lighting device (7.1), and an optical sensor (9), comprising the steps of:
- a control of the first lighting device (7.1), of the second lighting device (7.2), and of the optical sensor (9) are temporally coordinated with each other;
- assigning a visible spacing region (17) to the coordinated control;
- recording a first recording (21.1) with the optical sensor (9) by the coordinated control in an event of illumination by the first lighting device (7.1);
- recording a second recording (21.2) with the optical sensor (9) by the coordinated control in an event of illumination by the second lighting device (7.2);
- recording a third recording (21.3) with the optical sensor (9) without illumination by one of the first lighting device (7.1) and the second lighting device (7.2);
- forming a first difference recording (23.1) as a difference between the first recording (21.1) and the second recording (21.2);
- and
- forming a second difference recording (23.2) as a difference between the first recording (21.1) and the third recording (21.3) or as a difference between the second recording (21.2) and the third recording (21.3).