## 4 Recognition and Operation of Facade Protrusions
### Target Recognition Based on Binocular Vision  
The recognition of binocular vision consists of two main parts: one is the recognition of categories and the other is the recognition of dimensions. The flow chart of facade protrusion visual recognition is shown in Figure 4.  
Figure 3: Flow chart of facade protrusion recognition and parameter matching.  
The algorithm used in recognizing facade protrusion is the YOLOv5 algorithm based on a convolutional neural network (CNN). In the field of vision, in addition to CNN, there are also vision transformers (ViT) and graph neural networks (GNN) that can be used to process visual tasks. In this study, it is necessary to transplant the recognition algorithm and the effect inspection algorithm into the wall-climbing robot. The TX2 processor installed on the robot has weak performance and requires real-time detection. However, the high computational cost of ViT and GNN is not conducive to the real-time recognition of the robot in this paper. YOLOv5 has fast recognition speed, mature hardware deployment and good compatibility with TX2, so YOLOv5 was chosen as the recognition algorithm for facade protrusions.  
The YOLO detection algorithm was first proposed by [PERSON] et al. in 2016 [PERSON] (2016). YOLOv5 combines a large number of previous research techniques and implements appropriate innovative algorithms to achieve a balance of speed and accuracy [PERSON] (2016).YOLOv5 is slightly inferior to YOLOv4 in terms of performance but is far superior to YOLOv4 in terms of flexibility and speed, providing an extreme advantage in the rapid deployment of the model; therefore, YOLOv5 was used to recognize the target category.  
YOLOv5 includes five different network structures: YOLOv5n, YOLOv5s, YOLOv5m, YOLOv5l and YOLOv5x. Considering the processor performance and real-time requirements used, YOLOv5s was adopted, as it performs best on devices with limited computing resources, such as mobile devices. Compared to other network structures, it has fewer layers and lower computational complexity, while also meeting the recognition accuracy requirements of this study. Considering the size of the graphics memory, the batch is set to 8 and the training image resolution is set to 640 \(\times\) 640, the number of epochs is set to 500, the learning rate is set to 0.005 and the learning rate attenuation parameter is set to 0.25.  
To obtain the target size, binocular vision is used for the measurement and calculation of the facade protrusion distance. The binocular vision distance calculation principle is based on the similarity of triangles, and the depth information can be calculated by the triangle similarity principle [PERSON] (2016).  
Stereo matching is a key step in the implementation of binocular distance measurement, which is the process of finding the best matching pixel point in the left and right images taken by the binocular camera and computing the difference between the horizontal coordinates of the two-pixel points to obtain the parallax. The main algorithms studied were global stereo matching with graph cut and confidence propagation and local stereo matching based on the census algorithm and semi-global block matching (SGBM) [PERSON] (2016).  
Figure 4: Flow chart of facade protrusion visual recognition.  
The SGBM local stereo matching algorithm is used because of its fast computational speed while ensuring a certain level of accuracy, and the process of implementing the SGBM algorithm is divided into four steps: image pre-processing, cost calculation, dynamic planning and post-processing parallax refinement [30]. After the above process, SGBM is able to achieve a better parallax effect.