## 2 Materials and Methods
### Elaboration  
#### 2.5.1 Elaboration of the Psychophysical Parameters  
The data processing phase was developed with different approaches for the two test phases considered. In the first set of experiments, the data collected by the heart-rate measurement sensor were sent in real time to the smartphone application, also developed by the Sensibilab Laboratory. This app made it possible to obtain and manage information on HRV and RR. The data collected by the tool were then used as input to a specific software for the calculation and processing of the HRV parameter--Kubios--developed by the Biosignal Analysis and Medical Imaging Group of the University of Kuopio, Finland [36; 37]. This software allows the analysis of HRV and its components over discrete time intervals (with a minimum time interval of 30 s). Both the values of the different frequency components, i.e., VLF, LF, HF, and the LF/HF ratio, and the parameters in the time domain are provided. The latter values were not considered in the analysis as they are less related to stress conditions [16; 17]. An example of the information collected and processed is shown in Figure 7.  
Figure 6: Path selected for the second set of experiments (QGIS elaboration of Google Maps). Figure 7: Example of the information obtained with the use of the Kubios software (University of Kuopio, Kuopio, Finland) for heart rate variability (HRV) analysis [36; 37]. Concerning the GSR parameter, the values recorded by the instrument during the test, after being collected and analyzed by the application MAXREFDES#73, were consulted and processed as text files. The values of the LF, RR, and GSR parameters were reported on three graphs that illustrate their trends over time. By overlapping these graphs, thanks to the output synchronization, it was possible to identify the instances, or more correctly, the time intervals, in which a coincidence of the LF and GSR peaks was recorded. The comparison between several indicators provides further confirmation and allows overcoming the potential errors of the single device. For this reason, the points that were considered as stressful were those in which both parameters presented peak values. This condition allowed the identification of a first set of points in which the values of altered psychophysical status were recorded. However, for the identification of the points chosen for the comparison with black spots, the RR parameter recorded at the identified locations was also considered (its value must be greater than 20 breaths/minute to be considered as anomalous [21]), and a video-recording check of what the driver was seeing and perceiving during the test drive was made. In the second test phase, the data relating to the HRV parameter were collected and processed on the personal computer (PC) using the Mx Viewer software (developed by CSEM, Nazartel, Switzerland within the Pegaso project) [38], before being analyzed with the Kubios software, as in the first experimental phase. The HRV component considered for the analyses was the LF/HF ratio. Thresholds were defined, different for each driver, and four bands of stress/relaxation states were considered: stress, neutral-stress, neutral-relaxation, and relaxation. Each road section, defined in the road safety analysis phase, featured the following:  
* One of the four bands of accidents (high, medium-high, medium-low, low);
* The number of times (\(N\)) in which the parameter, LF/HF, fell into one of the four bands of stress/relaxation (for each of the bands: stress, neutral-stress, neutral-relaxation, or relaxation)  
As an initial and quick analysis, a correlation matrix was developed to assess whether high stress levels corresponded to high accident rates and vice versa (Figure 8). Each cell of the matrix contains the number of cases in which the level of stress reported in each row was recorded within a specific area characterized by a specific accidental level indicated in each column.