1. A system comprising: a stack of layers configured to display an image; and multiple elements included in the stack of layers, wherein each of the multiple elements is configured to sense light, wherein the system is configured to obtain a first reference image based on output from the multiple elements in a dark lighting condition associated with the system, obtain a second reference image based on output from the multiple elements in an ambient state of the system in which ambient light reaches the multiple elements, obtain at least one additional reference image based on output from the multiple elements in the ambient state, average the second reference image and the at least one additional reference image, and calibrate object detection based on output from the multiple elements using the first reference image and the averaged reference images.