1. A method comprising: generating a light pattern using a display panel; forming a virtual image from the light pattern utilizing one or more optical components, wherein the virtual image is viewable from a viewing location; receiving external light from a real-world environment incident on an optical sensor, wherein the real-world environment is viewable from the viewing location; obtaining an image of the real-world environment from the received external light; identifying a background feature in the image of the real-world environment over which the virtual image is overlaid; extracting one or more visual characteristics of the background feature; comparing the one or more visual characteristics to an upper threshold value and a lower threshold value; and controlling the generation of the light pattern based on the comparison.