## 2 Methodology  
### Respiratory Rate Estimation  
The contactless estimation of respiratory rate (RR) has revolutionized a conventional measurement of vital signs, usually obtained using wires and electrodes attached to the skin. Various studies have already proved that it's possible to accurately extract RR from sequences of a very small spatial resolution, e.g., 80 \(\times\) 60 [16]. In this study, we evaluate two respiratory rate estimators proposed and described in details in [44]: _eRR_sp_ and _eRR_as_. In the _eRR_sp_ estimator we assume that the respiratory signal is dominant in the signal spectrum. Thus, the detection of the maximum value in the frequency domain (the frequency value of the dominating peak) can be used for the RR estimation. The main drawback of this estimator is the fact that it always returns the result even for non-respiratory signals (such as noise) so it's advisable to use in together with other methods for reliable results. The second estimator utilizes the fact that the periodic signal and the auto-correlation sequence of it have the same cyclic characteristics. Calculation of the auto-correlation for following time lags and similar analysis as for _eRR_sp_ allows for estimating of RR values. Since this estimator uses the autocorrelation spectrum it is further referred to as _eRR_as_. Our primary contribution lies in applying RR estimators to thermal sequences previously enhanced with Convolutional Neural Network based Super Resolution (SR) model to verify if the accuracy of RR estimation can be improved with deep learning (DL). The DL model proposed by us is compared against the Eulerian Video Magnification (EVM) algorithm [22]. In addition, we also examine the influence of resolution degradation on the accuracy of RR estimation by down-scaling thermal sequences with bicubic interpolation. In this work, we utilized short data segments (300-400 samples) for RR values extraction. The limited window size enables the use of contactless RR estimation in many practical applications due to the short acquisition and processing time. In addition it allows for reducing possible motion artifacts, as the person doesn't have to be still for a very long time. At first, we analyzed the original sequences without spatial resolution modifications. The raw breathing signal was constructed by aggregating pixel values within the manually selected region of interest (ROI) using the average or the skewness operator. As previously verified in [44], if the skewness aggregation is applied, the extracted waveforms are practically insensitive to the size of the ROI, assuming the whole area of a nose is marked. On the other hand, the averaging operation applied to bigger regions leads to the smoothing effect of the respiratory-related pixel values changes, making the extraction of RR values almost impossible. Taking it into account, in case of the skewness operator, we selected the ROI which was covering the whole nose, while for the averaging it was covering a smaller area (e.g. nostrils only), as presented in Figure 1.  
The obtained raw signals were filtered using moving average filter and the 4 th-order high pass Butterworth filter (the cutoff frequency set to 0.125 Hz). Then, both RR estimators were applied in order to extract respiratory values. The same procedure was used for all other sequences, i.e., EVM, SR and bicubic without changing the location of the selected ROI to compare influence of resolution enhancement/degradation on the value of the estimated vital sign. In this way, we were able to evaluate how RR changes if a spatial resolution is decreased or improved with image processing techniques, as the area used for obtaining signals remained constant. The Root Mean Square Error was calculated using a difference between values of RR computed with RR estimators and a reference RR value. The process of obtaining thermal sequences and reference respiratory signals is described in details in the following section.