## 2 Materials and Methods
### Overall Method Description
#### Hermite Transform-Motion Magnification  
In this work, we used an implementation of the Eulerian motion magnification method [22] through Hermite transform (HT) [32] to represent the spatial features of the image sequence. The Hermite transform description can be seen in Appendix A. Following this, we present the Eulerian motion magnification basis, and we describe its implementation using Hermite transform. Let \(I(X,t)\) an image sequence, where \(X=(x,y)^{\top}\) represent the pixel position; \(W(t)=\left(\delta_{x}(t),\delta_{y}(t)\right)^{\top}\) represents the corresponding displacements within the image domain and \(t\) is the time associated with each image in the sequence. Thus, the intensities of pixel \(X\) on the image sequence can be expressed as a function of displacement \(W(t)\):  
\[I(X,t)=f\Big{(}X+W(t)\Big{)}, \tag{1}\]  
where \(I(X,0)=f(X)\) is the first image of the sequence. Applying the Hermite transform to Equation (1), we obtain a set of functions defined in terms of the displacement function \(W(t)\) as shown in Equation (2):  
\[I_{m,n-m}(X,t)=f_{m,n-m}\Big{(}X+W(t)\Big{)}, \tag{2}\]  
with \(I_{m,n-m}(X,0)=f_{m,n-m}(X)\). The Eulerian motion magnification method [22] consists of amplifying the displacement function \(W(t)\) by a factor \(\alpha\) to obtain a synthesized representation of the Hermite coefficients:  
\[\hat{I}_{m,n-m}(X,t)=f_{m,n-m}\Big{(}X+(1+\alpha)W(t)\Big{)}. \tag{3}\]  
If we applied in Equation (2) a first-order Taylor decomposition to \(I_{m,n-m}(X,t)\), we obtain:  
\[I_{m,n-m}(X,t)\approx f_{m,n-m}(X)+W(t)^{T}(\
abla f_{m,n-m}(X)), \tag{4}\]  
where \(\
abla\) represents the gradient operator and \(W(t)^{T}(\
abla f_{m,n-m}(X))\) represents the high-order terms of the Taylor expansion, i.e., the motion components of the Hermite coefficients. Next, we applied a broadband temporal band filter to Equation (4) to retain the displacement vector \(W(t)\) obtaining:  
\[B_{m,n-m}(X,t)=W(t)^{T}(\
abla f_{m,n-m}(X)). \tag{5}\]  
Figure 1: Block diagram of the breath rate estimation system showing the CNN-ROI and CNN-Whole-Image approaches. Multiplying \(B_{m,n-m}(X,t)\) by the factor \(\alpha\) and summing it to \(I_{m,n-m}(X,t)\) we obtain:  
\[\widetilde{I}_{m,n-m}(X,t)=I_{m,n-m}(X,t)+\alpha\left(W(t)^{T}(\
abla f_{m,n-m}( X))\right). \tag{6}\]  
Replacing \(I_{m,n-m}\) in Equation (6) by the Taylor expansion of Equation (4) we obtain:  
\[\widetilde{I}_{m,n-m}(X,t) \approx f_{m,n-m}(X)+W(t)^{T}\left(\
abla f_{m,n-m}(X)\right)+ \alpha\left(W(t)^{T}(\
abla f_{m,n-m}(X))\right)\] \[\approx f_{m,n-m}(X)+W(t)^{T}(1+\alpha)\left(\
abla f_{m,n-m}(X) \right). \tag{7}\]  
We can demonstrate that if the first-order Taylor series holds in Equation (7), the amplification of the temporal bandpass signal \(B_{m,n-m}(X,t)\) is related to the motion amplification of Equation (3):  
\[\widetilde{I}_{m,n-m}(X,t)\approx f_{m,n-m}\Big{(}X+(1+\alpha)W(t)\Big{)}. \tag{8}\]  
Finally, the motion magnification sequence \(\widetilde{I}(X,t)\) can be obtained by applying the inverse Hermite transform to Equation (8) (see Appendix A):  
\[I_{m,n-m}(X,t)=f_{m,n-m}\Big{(}X+W(t)\Big{)}, \tag{2}\]0  
In practical terms, instead of summing the magnified spatial components and then performing the inverse Hermite transform, we can interchange it and first perform the reconstruction of the magnified spatial components and then sum it with the original image. This is because the inverse Hermite transform (Equation (A4)) and the motion magnification technique (Equation (6)) are both linear processes. The Eulerian motion magnification proposal used in this work can be summarized as follows:  
1. Carry out a spatial decomposition of the image sequence using Hermite transform. This allows decomposition of the image sequence into different spatial frequency bands that are related with different motions (see Equation (4))
2. Perform a temporal filtering of the spatial decomposition to retain the motion components (Equation (5)).