For this app, we need to return to the cross-platform wxPython framework. Optionally, we can also develop and test our wxPython application on a Windows, Mac, or Linux desktop or laptop before deploying it to our Raspberry Pi computer. With the Raspbian operating system, the Pi can run wxPython, just as any Linux desktop could.
The GUI for The Living Headlights includes a live video feed, a set of controls where the user can enter their true distance from headlights, and a label that initially displays a set of instructions, as seen in the following screenshot:
When a pair of headlights is detected, the user must perform a one-time calibration step. This step consists of entering the true distance between the camera and headlights (specifically, the midpoint between the headlights) and then clicking on the Calibrate button. Thereafter, the...