## 2 Measurement Approach
### Wedge Detection Algorithm
#### 2.3.3 Determination of the Wedge Area  
In order to determine the additional area with turbulent flow in a thermogram caused by premature flow transitions, the area \(A\) of all \(N\) wedges in a thermogram needs to be known. The total area \(A\) is determined by summing up the area \(A_{i}\) of each wedge:  
\[A=\sum_{i=1}^{N}A_{i}. \tag{5}\]  
The area \(A_{i}\) of each turbulence wedge in the thermogram is calculated with the formula  
\[A_{i}=\frac{1}{2}h_{i}w_{i}, \tag{6}\]  
Figure 4: Illustrative analysis of a simulated thermogram (**a**) to detect the turbulence wedges’ positions. The position detection is implemented using cross-correlations with randomized templates (**b**). Maxima in the relative frequency of minima in the cross-correlation results (**c**) determine the position of the turbulence wedges. (**a**) Simulated thermogram with three differently sized wedges. The wedge on the right has a lower contrast. The rectangle on the left side represents a template in its starting position, with an arrow below indicating the direction in which it is moved pixel-wise during the cross-correlation. (**b**) Cross-correlation \(C[x]\), see Equation (4), of the simulated thermogram in (**a**) and \(J=100\) templates of varying sizes. Each color corresponds to a template of a different size. In this example, the smallest template has a size \((h^{\prime},w^{\prime})\) of \((27,8)\) pixel; the largest \((41,16)\) pixel. Local minima are marked with a dot. (**c**) Relative frequency of minima in the results of the cross-correlations. Each position \(x_{i}\) of a maximum (orange dot) is marked. The cut-off percentage of 35% is marked with a dashed gray line. where \(h_{i}\) denotes the height and \(w_{i}\) the width of the wedge at the position \(x_{i}\). In order to determine \(h_{i}\) and \(w_{i}\), a measure of similarity between a template at the position \(x_{i}\) and the thermogram section of the same size is required, which is calculated for different template sizes but at a fixed position to finally identify the most fitting template size. The chosen measure of similarity is the weighted correlation, which is selected instead of the regular correlation due to the intensity gradient near the leading edge in the thermogram, which leads to a low contrast between the wedge's tip and the surrounding region. This low contrast between tip and surrounding causes the wedge height to be estimated too small and therefore leads to an erroneously determined wedge area. By using the weighted correlation, which weights a good fit between the template and the wedge at the base stronger than at the tip, the intensity gradient near the wedge's tip is counteracted. The weighted correlation in between a template \(\tau\) and the thermogram section \(\iota\) is defined as  
\[\text{corr}(\tau,\iota)=\frac{\text{cov}(\tau,\iota)}{\sqrt{\text{cov}(\tau, \tau)\text{cov}(\iota,\iota)}}, \tag{7}\]  
the covariance is the weighted covariance according to  
\[\text{cov}(\tau,\iota)=\frac{\sum_{p}\sum_{q}\gamma_{pq}\cdot(\tau_{pq}-\overline {\tau})(\iota_{pq}-\overline{\tau})}{\sum_{p}\sum_{q}\gamma_{pq}}, \tag{8}\]  
with the weight matrix \(\gamma\) and the weighted mean values  
\[\overline{\tau}=\frac{\sum_{p}\sum_{q}\gamma_{pq}\gamma_{pq}}{\sum_{p}\sum_{q }\gamma_{pq}},\quad\overline{\iota}=\frac{\sum_{p}\sum_{q}\gamma_{pq}\iota_{ pq}}{\sum_{p}\sum_{q}\gamma_{pq}}. \tag{9}\]  
The index \(p\) indicates the row index of each matrix, while \(q\) is the column index. To determine the height \(h_{i}\) and the width \(w_{i}\) of the wedge at the position \(x_{i}\), the template \(\tau_{0,i}\) with the height \(h^{\prime}=h_{0,i}\) and the width \(w^{\prime}=w_{0,i}\), which was determined during the detection of the wedges' positions in Section 2.3.2, is used as an initial wedge size for the search. Since the sizes of the templates used in the position detection are chosen randomly, it is not ensured that \(h_{0,i}\) and \(w_{0,i}\) are the actual height and width of the turbulence wedge at the position \(x_{i}\).