In one embodiment, an imaging system illuminates a surface of tissue with one or more spots of near-infrared (NIR) light within a field of view of a camera of the imaging system. The imaging system captures an image of the one or more spots of NIR light within the field of view of the camera of the imaging system. The imaging system calculates, for each of the one or more spots of NIR light in the captured image, a spot diameter, spot position, or spot shape in the captured image. The imaging system determines a distance between the imaging system and the surface of tissue, based on the calculated spot diameter, spot position, or spot shape of the one or more spots of NIR light in the captured image. The imaging system provides data indicative of the determined distance between the imaging system and the surface of tissue to an electronic display.