## 3 Weak Interlayer Identification Method
### Optical Image Characteristics of Weak Interlayer
Since the hole wall texture feature response function TF needs to describe the composition of rock mass per unit depth at the borehole depth h and the degree of filling cement, and the gradient distribution on each scanning line needs to be considered, the hole wall texture feature response function \(TF(h,i)\) takes the average value of RGB gradient of the image on the \(i\)-th scanning line per unit length at \(h\), and its expression is:  
\[TF(h,i)=1-\frac{\left(\
abla f_{h,i}|_{r}+\
abla f_{h,i}|_{g}+\
abla f_{h,i}|_ {b}\right)}{3} \tag{4}\]  
where \(\
abla f_{h,i}|_{r}\) represents the red image gradient corresponding to the \(i\)-th column scanning line at the borehole depth \(h\). \(\
abla f_{h,i}|_{g}\) represents the green image gradient corresponding to the \(i\)-th column scanning line at the borehole depth \(h\). \(\
abla f_{h,i}|_{b}\) represents the blue image gradient corresponding to the \(i\)-th column scanning line at the borehole depth \(h\). The smaller the value of the hole wall texture feature response function, the more obvious the corresponding texture mutation, and the darker the corresponding color in the texture  
Figure 4: Optical image and grid division. (**a**) Optical unfolded image, (**b**) grid division of optical unfolded image. feature image. The larger the value of the hole wall texture feature response function, the less obvious the corresponding texture mutation, and the lighter the corresponding color in the texture feature image. The borehole expansion image can show the integrity characteristics of the borehole wall, but due to the interference of the environment and the equipment itself, the formed image has some noise. It is necessary to enhance the image of the target area to highlight the abnormal area, so as to realize the integrity characteristics of the system hole wall. Because optical imaging is affected by different wavelengths, the component images corresponding to different wavelengths also have different characteristics. Therefore, in the calculation of the hole wall integrity characteristic response function IF, the local and global characteristics of the image are comprehensively considered from the image characteristics of different wavelengths. By establishing an image search window, the difference between the maximum value and the minimum value of the long wavelength information intensity in the image search window area of the whole borehole is searched and scanned, that is, the expression of the local feature \(L(h,i)\) of the image is:  
\[L(h,i)=\max_{h,i\in\Omega}(S_{r})-\min_{h,i\in\Omega}(S_{r}) \tag{5}\]  
where \(\Omega\) is the search window, and the search window scans the optical image of the whole structure in a single pixel step. The long wavelength information in the optical image is used to characterize the local characteristics of the image, and the global contrast of the short wavelength information is extracted by using the feature of the weakest attenuation of the short wavelength optical information to form a significant global difference feature, that is, the expression of the image global feature \(O(h,i)\) is:  
\[O(h,i)=\sum_{m=1}^{M}\sum_{n=1}^{N}\lVert S_{b}(h,i)-S_{b}(m,n)\rVert \tag{6}\]  
where \(M\) is the number of rows of pixels in the borehole expanded image, and \(N\) is the number of columns of pixels in the borehole expanded image. In the aspect of hole wall integrity feature calculation of borehole unfolding image, a variety of image features are fused. The hole wall integrity feature response function \(IF(h,i)\) considering the local feature \(L\) and the global feature \(O\) of the image is constructed. The hole wall integrity characteristic response function \(IF(h,i)\) represents the scale of the maximum complete rock mass in the unit length corresponding to the \(i\)-th scanning line at the borehole depth \(h\), and its expression is:  
\[IF(h,i)=L(h,i)\times O(h,i) \tag{7}\]  
Among them, \(h\) and \(i\) need to be normalized according to the values of p and q, that is, \(h\)\(\in\)[1, p], \(i\)\(\in\)[1, q].