## 4 Analysis
### Heart Rate Analysis  
These analyses compare the 177 s of HR data extracted from the video footage by _PyVHR_ of participants responding to the instructional film, with the 177 s of HR data measured by the _Polar H10_ contact sensor. The sample rate of both these univariate signals is 1 Hz. The relationship between the camera-measured signal and the expected heart rate, from the _Polar H10_ contact sensor, can be quantified by calculating the average MAE and PCC for each video. In Figures 13 and 14 the distribution of these performance scores is shown, for each illumination condition.  
The distribution of each metric in each illumination condition was tested for normality using the Shapiro-Wilk test [66]. All six distributions were shown to be normally distributed, so parametric statistics were used in subsequent analysis. The PCC distributions were found to meet the assumption of sphericity, using [PERSON]'s test of sphericity [67]. However, the MAE distributions did not meet the assumption of sphericity, so the Greenhouse-Geisser correction was applied [73]. A repeated measures ANOVA [68] was applied revealing that there were significant differences in both mean MAE and PCC  
Figure 14: Box plot showing the distribution of PCC values quantifying the relationship between the expected target heart rate signal from the contact sensor and the camera-measured signal for each illumination condition. Each cross, in the overlaid swarm plot, shows an individual value within the distribution. The means and standard deviation of the distributions are as follows: Bright (mean: 0.28, std: 0.24), Medium (mean: 0.01, std: 0.29), Dark (mean: 0.19, std: 0.30).  
Figure 13: Box plot showing the distribution of MAE values quantifying the difference between the expected target heart rate signal from the contact sensor and the camera-measured signal for each illumination condition. Each cross, in the overlaid swarm plot, shows an individual value within the distribution. The means and standard deviation of the distributions are as follows: Bright (mean: 3.20, std: 1.11), Medium (mean: 16.12, std: 9.01), Dark (mean: 23.81, std: 6.89).  
values between the illumination conditions (MAE: F = 43.415, \(p\) < 0.01) (PCC: F = 14.716, \(p\) < 0.01).  
As post hoc analyses, pairwise comparisons were made to assess the significance of the difference in mean MAE and PCC between each illumination condition. This was done using the dependent \(t\)-test. As multiple comparisons are made Bonferroni adjustment [69; 70] is applied, leading to an adjusted significance threshold of \(p\) < 0.008. These results can be seen in Table 6. They show a statistically significant difference for all pairwise comparisons, apart from between Dark and Medium conditions for PCC.  
In Figure 15, the residual error, the difference between the heart rate measurements from the contact sensor and the camera-based solution, is shown. Visual inspection of this graph suggests the system commonly overestimates the heart rate in medium and dark conditions. The prevalence of frames recorded with a heart rate of zero during the dark introduction part of the film can also be seen in this figure. Through further inspection of the two signals, it appeared that the camera-based measurement would also often increase and decrease by large increments over the course of only a few seconds. This characteristic _spiking_ can be seen in Figure 16. In Figure 17, the relation between the heart rate values recorded with the _Polar H10_ is compared to the data obtained using _PyVHR_, for each corresponding sample, using a two-dimensional histogram. This visualisation highlights both the tendency for the camera-based system to overestimate as well as the tendency to make measurements of zero BPM in the dark illumination condition. Moreover, it highlights the commonality of erroneous readings between 120 BPM and 130 BPM in bright and medium illumination conditions.