## 2 Materials and Methods  
### Monitoring System  
We developed an evolved version of a prototype of an electronic system (Brescia, Italy) that we previously described [17]; in that study, some work tasks of VDT operators were analyzed by collecting and interpreting data about visual interactions and electrical impulses from the mouse and keyboard. The new version of the prototype consists of a standalone PC-based monitoring system in the form of a laptop equipped with a commercial webcam. This was designed with ergonomics in mind and protection of the user's privacy, and the system does not interfere with the user's posture or comfort while they are working at their VDT station. The monitoring system does not save any photographs or videos of the user, only the data related to the user's presence and their active viewing of the monitor paired with a timestamp. The system is based on three main modules:  
* An image capture module that uses a webcam to capture video streams of the user's face. * A processing and analysis module that is located on the monitoring PC. The software module employs image processing algorithms to analyze the video stream and detect user presence and monitor active engagement. * A user interface that provides feedback and logs data for further analyses. The webcam is placed in front of the worker's VDT station to capture real-time videos of the user's face. The video stream is then fed to the PC-based monitoring system, which uses specifically designed algorithms to analyze the user's facial features and determine presence and eye fixation on the display. A combination of image processing algorithms was developed to analyze the captured video stream. The analysis is carried out via the following steps:  
* Facial detection;
* Eye and pupil detection;
* Eye fixation and attention assessment. To detect the user's presence in front of the screen, the system employs a facial detection algorithm to identify the user's face in the webcam feed. When any face is detected, the user is considered present. Additionally, the system tracks the user's facial movements to ensure that they remain within the webcam's field of view. If the user's face disappears from the frame, the worker is considered to be absent from the workstation. When a face is detected, the algorithm determines the positions of both the eyes and the pupils. To determine whether the user is actively engaged with the monitor, the system analyzes the user's gaze. This is achieved via an algorithm that detects the user's eyes in the webcam feed and the position of the pupils. If the position of each pupil is detected within a preset tolerance area around the center of the identified eye area, the system considers the user to be actively visually engaged. If both the user's eyes are open and both pupils are detected in the center of the respective eyes within the tolerance area, the user is considered to have their gaze fixed on the monitor and be actively paying attention. However, if a user's eye is closed or the gaze is directed away from the monitor, the system considers the worker to not be actively engaged. The interface displays the webcam video stream with overlays indicating the detected positions of the face, eyes and pupils. Additionally, it displays the user's presence and eye fixation on the monitor. The interface also reports the user presence and engagement events paired with corresponding timestamps for further analysis by providing log files. The log files can be successively analyzed to determine and compute the times of user presence and eye fixation on the display during the monitored work session. The PC-based monitoring system is implemented via a combination of software libraries and tools. The general-purpose nonproprietary algorithms included in the OpenCV library (v. 4.4.0) [33] are used for image processing and computer vision tasks, such as the detection of faces, eyes and pupils.