## 4 Methods
### Mosaic of borehole Video
#### 4.3.2 Proposed PTSAD Algorithm
In order to compare the feasibility and effectiveness of the proposed method with other established algorithms, we conducted the same experiments on the image matching by the feature-based of SIFT [36] and the full-search (FS) of NCC and SAD [37]. Figure 16a,c are the resource image and the examined image in the template matching respectively. Figure 16b is the template extracted from the resource image, that is, the black rectangle in Figure 16a. The template shifted over the whole area in the examined image and compared to the candidate images of the same size as the template. In Figure 16c, red, yellow and blue rectangles are the three candidate images with the minimum SAD value in ascending order. It is obvious that the candidate image of the yellow rectangle was the most similar to the template, whereas the minimum SAD value was the candidate image of the red rectangle. Thus, the search result could sometimes be inefficient when drawn from the traditional SAD algorithm. Similarly, when the borehole-wall images had smooth texture or no distinctive features, as shown in Figure 17, the candidate image of the minimum SAD value was not the candidate image matching with the template. In Figure 17c, the candidate image of the third-smallest SAD value (blue rectangle) was the candidate image matching with the template. In order to identify the best candidate image from three candidate images, the GPT was used as the decision module in our PTSAD algorithm. By computing the correlation coefficients of one-dimensional projection vectors obtained by GPT and comparing the correlation between the template and the three

Figure 16: Three candidate images in fracture borehole image. (**a**) Resource image; (**b**) template and (**c**) examined image. Figure 17: Three candidate images in a smooth borehole image. (**a**) Resource image; (**b**) template and (**c**) examined image. candidate images, the candidate image matching with the template could be recognized from the candidate images. Figure 18a is the template image, namely, the black rectangle in Figure 16a. Figure 18(a1,a2) are horizontal and vertical projection curves of the template respectively. Figure 18b-d are the three candidate images, namely the yellow, red and blue rectangles shown in Figure 16c. Their corresponding projection curves are shown in Figure 18. The results of the projection curves show that the candidate image matching with the template (Figure 18(b1,b2)) had a more similar waveform compared to the template (Figure 18(a1,a2)) than the other two candidate images. The correlation coefficient of the projection vector was calculated by Equation (5). As shown in Figure 19, TY, TR and TB were the correlation coefficients between the template and the yellow, red and blue candidate images respectively. HCC and VCC are the correlation coefficients of the horizontal

Figure 18: The horizontal and vertical projection curves of the template and candidate images. (**a**) Template; (**a1**) horizontal projection curve of the template and (**a2**) vertical projection curve of the template. (**b**) Yellow candidate image; (**b1**) horizontal projection curve of the yellow candidate image and (**b2**) vertical projection curve of the yellow candidate image. (**c**) Red candidate image; (**c1**) horizontal projection curve of the red candidate image and (**c2**) vertical projection curve of the red candidate image. (**d1**) Blue candidate image; (**d1**) horizontal projection curve of the blue candidate image and (**d2**) vertical projection curve of the blue candidate image. projection vector and vertical projection vector respectively. Consistent with the results shown in Figure 18, the yellow candidate image (Figure 18b) was the most similar candidate to the template and had the maximum correlation coefficients in the horizontal projection and vertical projection.