# A Novel Approach against Sun Glare to Enhance Driver Safety
## Materials and Methods
### Implementation Aspects  
Since we did not have all the necessary resources to create a real car prototype, a simulation was preferred in order to test and confirm the theoretical part. It is known that not all real-life issues can be covered by simulations, therefore, we could only predict some aspects like the runtime, task prioritization, or memory usage. Moreover, it is considered that glare represents an issue only on sunny weather conditions or when the driver provides a feedback by pressing a button. Light intensity sensors and sun tracking sensor, alongside some extra data that can be received from the car like the current time of the day, can be used to determine if the dark spot will be created or not. Several scripts were created to cover the use cases when the driver position is fixed, and the sun's position is mobile and vice versa. All variables are configurable in an input script, and in this manner, the user can control the following aspects of the simulation: the size of the windshield (L = width and l = height), the angle between the reference plan and the windshield plan (\(\varphi\)), the coordinates of the driver's eye (D), and the sun's position (\(\alpha\)x and \(\alpha\)y). The flow chart of the whole sun shading modeling process is described in Figure 9.  
Figure 9: Shading system flow chart. The components involved in providing the information needed to operate the system are a set of photo cameras tracking the position of the driver's eyes, the sensor that provides the direction of the sun's rays, and the sensor that provides the level of brightness. If the digital sunshade is needed, all the data are sent to the ECU. The computational power required should be present on all the vehicles, due to the fact that this is not a high priority task and its cyclicality can be configured to a value like T = 1 s. The priority and cyclicality are based on the fact that even if it is a road safety feature, it cannot be compared to other safety features such as automatic breaking or airbag triggering. The variations in this process are slow since the direction of the car is not changing that often even in the city, the same hypothesis being applied for the sun or driver's head movement. After the intersection point between the sunbeam and the windshield is found, the HUD driver is instructed in concordance and the dark spot is created, its transparency being in concordance with the light intensity. As mentioned above, the current paper does not aim to solve the driver's eye tracking problem. Therefore, some already existing solutions will be presented as examples as what could be used to cover this part of the whole environment. A functioning camera-based eye tracking system is presented in [19]. Some very important aspects are that the system is capable of having the following features at real-time speed: face tracking, pose estimation, gaze direction estimation, and failure detection and recovery. The hardware structure of this kind of system is presented in Figure 10.  
As can be seen, the two cameras are placed equidistant from the origin point and are rotated towards the origin in the horizontal plane. Specific regions of the human face are tracked like the corners of eyes, mouth, nose, ears, and eyebrows. Next, the eyes are considered as spheres and the gaze direction is given by the direction of a line starting from the eyeball center. The intersection point of both eyes is the gaze point. Due to the progress made in the last years on the image acquisition, such a system would not add much costs and will provide very good results. Nowadays, even more companies like Smart Eye [20] offer solutions based on a single camera and LED lights (Figure 11). The infrared light's purpose is to reflect from the eye's cornea, and thus, the camera will be able to detect the eye's position. From this point, image processing is used to track the driver's gaze and eye position. Furthermore, algorithms based on AI (artificial intelligence) principles are used to interpret the gestures of the driver.