## 3 Implementation of the Model-Based Algorithm and the Experimental Setup
### Numerical Implementation of the Algorithm
Consequently, the templates' widths are drawn from a normal distribution with \(\mathcal{N}(\mu_{w^{\prime}}=h_{j}^{\prime}/3,\sigma_{w^{\prime}}^{2}=0.2)\), where \(\mu_{w^{\prime}}\) is the mean and \(\sigma_{w^{\prime}}^{2}\) is the variance of the normal distribution. To calculate the cross-correlation between the thermogram and each turbulence wedge template, the template with index \(j\) is placed with its top left corner at \(x_{0}=0\) and \(y=y_{\text{NT}}(x_{0})\) as a starting point. A section of the full thermogram the same size as the template is required for the cross-correlation calculation. The columns (i.e., the width) of the thermogram section are chosen from the position \(x\) to \((x+w_{j}^{\prime})\) of the full thermogram. The rows (i.e., the height) of the thermogram section are determined from the position  
Figure 5: Flowchart of the model-based algorithm. \(y_{\text{TE}}\) are the \(y\)-positions of the trailing edge, \(y_{\text{NT}}\) the \(y\)-positions of the natural transition line and \(y_{\text{LE}}\) the leading edge’s \(y\)-positions. The output quantities, which are highlighted with a colored circular background, are the \(x\)-position \(x_{i}\), the height \(h_{i}\), the width \(w_{i}\) and the area \(A_{i}\) of each turbulence wedge, where \(i\) denotes a running wedge number. \(y_{\text{NT}}(x)\) to \((y_{\text{NT}}(x)+h_{j}^{\prime})\). The cross-correlation of the thermogram section and the template is calculated using Equation (4) and the template is moved to the right by 1 pixel. This way, the cross-correlation value \(C[x]\) is calculated for each \(x\)-position. However, when the right edge of the template reaches the right edge of the thermogram, the top left corner is at \(x=w_{\text{therm}}-w_{j}^{\prime}\), where \(w_{\text{therm}}\) is the width of the thermogram. For the remaining \(x\)-positions the cross-correlation can not be calculated as the template would otherwise protrude outside the borders of the thermogram. Therefore, due to the different widths \(w_{j}^{\prime}\) of each template, the length of the cross-correlation curve of each template is different. To align the results of the cross-correlations of different templates, the cross-correlation values for each template \(j\) are shifted to the right by \(w_{j}^{\prime}/2\) and the maximum cross-correlation value is subtracted. Using the aligned cross-correlation curves, the relative frequency of minima is determined. The positions of the local maxima above 35% in the relative frequency then correspond to the wedge positions \(x_{i}\). The threshold value of 35% can be adapted depending on the desired sensitivity of the algorithm. The higher the threshold value, the more contrast the turbulence wedges need to have in order to be detected, which can lead to overlooked turbulence wedges. A lower threshold value, on the other hand, can result in an erroneous detection of noisy structures in the image as a turbulence wedge. Note that the relative frequency is currently not interpolated, i.e., the wedge positions \(x_{i}\) are integer values. As the last step of the wedge detection algorithm, the wedges' sizes \((h_{i},w_{i})\) and their areas \(A_{i}\) are determined for each wedge position \(x_{i}\) using a weighted correlation, see Section 2.3. For each \(x_{i}\), the initial template \(\tau_{0,i}\) with the size \((h_{0,i},w_{0,i})\) is used to create a range of new templates. Each template is then compared to the wedge to find the template with the best fit to the turbulence wedge. The sizes of the new templates are taken from a range of  
\[h_{0,i}-3\,\text{pixels}\leq h_{k}^{\prime}\leq h_{0,i}+3\,\text{pixels} \tag{12}\]  
for the height and  
\[w_{0,i}-3\,\text{pixels}\leq w_{k}^{\prime}\leq w_{0,i}+3\,\text{pixels} \tag{13}\]  
for the width. For each height and width combination of the two intervals, a new template is created, which results in \(K=49\) templates in total with running template index \(k\).