# Estimation of Wind Turbine Blade Icing Volume Based on Binocular Vision
## 2 Principle and Method
### Stereo Matching
#### 2.1.1 Matching Cost Calculation
The traditional Census transform yields significant fluctuations in the binary sequences obtained, whereas the improved Census transform effectively resists noise interference. Its transformation results remain consistent, demonstrating good robustness. In this experiment, the noise threshold is set to \(\alpha=2\). After the aforementioned adjustments, the dependence on the central pixel has been effectively reduced; however, the information within the image matching window is still not fully utilized. Therefore, this paper introduces edge point information and corner point information to improve the algorithm's performance in weakly textured and repetitive textured regions. Firstly, the input image undergoes edge detection using the Canny algorithm, and it is then encoded as:  
\[E(q)= \begin{cases}1,&\text{if }q\text{ is an edge point}\\ 0,&\text{if }q\text{ is not an edge point}\end{cases} ,\quad q\in\Omega_{\text{image}} \tag{6}\]  
Figure 4: Comparison between the traditional Census transform and the improved Census transform. Figure 3: Comparison of improved algorithms and traditional algorithms under the influence of noise. Next, the Harris corner detection algorithm is used to compute the corner responses of the image, which are also encoded as:  
\[C(q)= \begin{cases}1,&\text{if $q$ is a corner point}\\ 0,&\text{if $q$ is not a corner point}\end{cases} ,\quad q\in\Omega_{\text{image}} \tag{7}\]  
Finally, the fusion encoding process of corner and edge information is illustrated in Figure 5.  
By combining the improved Census transform with corner and edge information, we perform fusion encoding resulting in a four-bit binary code. Based on this, the Hamming distance is calculated to obtain the cost value. Using the above method can effectively handle situations where the overall brightness of the two images is inconsistent. The window-based method is more robust to image noise and has certain robustness to weak textures, better reflecting the true correlation. However, its disadvantage is that it can produce ambiguity in repetitive textures. To alleviate the ambiguity problem of repetitive textures, we further form a fusion cost by using the improved Census cost, Absolute Difference (AD) cost, and gradient cost. The Absolute Difference cost is defined as:  
\[C_{\text{AD}}(p,d)=\sum_{i\in\{R,G,B\}}\left|I_{i}^{\text{Left}}(p)-I_{i}^{ \text{Right}}(p-d)\right| \tag{8}\]  
where \(C_{\text{AD}}(p,d)\) represents the Absolute Difference (AD) cost of pixel \(p\) at disparity \(d\). \(I_{i}^{\text{Left}}(p)\) is the pixel value of the \(i\)-th color channel (R, G, or B) at position \(p\) in the left image, and \(I_{i}^{\text{Right}}(p-d)\) is the pixel value of the \(i\)-th color channel at position \(p-d\) in the right image. The position \(p-d\) is calculated from pixel \(p\) in the left image based on disparity \(d\). The gradient cost is defined as:  
\[C_{\text{gradient}}(p,d)=\frac{1}{3}\sum_{i\in\{R,G,B\}}\left|\sqrt{\left( \
abla_{x}I_{i}^{\text{Left}}(p)\right)^{2}+\left(\
abla_{y}I_{i}^{\text{Left }}(p)\right)^{2}}-\sqrt{\left(\
abla_{x}I_{i}^{\text{Right}}(p-d)\right)^{2}+ \left(\
abla_{y}I_{i}^{\text{Right}}(p-d)\right)^{2}}\right| \tag{9}\]  
where \(C_{\text{gradient}}(p,d)\) represents the gradient cost of pixel \(p\) at disparity \(d\). \(\
abla_{x}I_{i}^{\text{Left}}(p)\) and \(\
abla_{y}I_{i}^{\text{Left}}(p)\) denote the gradients of the \(i\)-th color channel at position \(p\) in the left image in the \(x\) and \(y\) directions, respectively; \(\
abla_{x}I_{i}^{\text{Right}}(p-d)\) and \(\
abla_{y}I_{i}^{\text{Right}}(p-d)\) denote the gradients of the \(i\)-th color channel at position \(p-d\) in the right image in the \(x\) and \(y\) directions, respectively. The combined normalized cost is defined as:  
Figure 5: The process of fusing corner and edge information into a combined encoding.