A method and system to compensate for stray light errors in time of flight (TOF) camera systems uses reference targets in the in the field of view (FOV) that can be used to measure stray light. In different embodiments, one or more reference targets are used.