# Exploration of Kastification and Characterization Based on Borehole Image
## 3 Identification of the Karst Pore Structure
### Bore Image Preprocessing  
Due to the actual borehole optical image acquisition process, the probe is prone to be eccentric, and the image formed is usually prone to light and shade features, as presented in Figure 4a. To eliminate this image phenomenon and highlight the karst pore structure features, borehole image preprocessing is required before pore identification. The optical images presented below depict a borehole located in Kunming, Yunnan Province, China, which belongs to the karst development stratum. The borehole depth is 15 m, the diameter is 110 mm, and the borehole fluid is a water-based slurry. In the whole borehole, the karst development of the 5.0-5.5 m section borehole wall is more obvious. Thereby, such a section is considered as the research object for further analysis. Figure 4a demonstrates the optical image of the hole wall from 5.0 to 5.5 m, vertical from top to bottom varies in the range of 5.0-5.5 m, and horizontal from left to right to north-east-south-west to north. As can be seen from Figure 4a, there is an apparent light and shade alternation in the unfolding image of the borehole, which is essentially related to probe bias in the process of image acquisition. The basic principle of preprocessing in the present work is to exploit the eccentric image acquisition model to enhance the hole wall image in various directions (i.e., the enhancement degree of pixel points in various directions is different). Figure 4: Images before and after borehole image preprocessing: (**a**) original image, (**b**) lightness image, (**c**) bright position change curve, and (**d**) the processed image. The core of this preprocessing is to determine the azimuth angle associated with the strongest light point, which corresponds to the shortest distance between the light source and the hole wall. RGB color space is one of the most broadly exploited color systems, which includes the changes of red (\(R\)), green (\(G\)), and blue (\(B\)) (i.e., three color channels) and their superposition to acquire a wide variety of colors. The HSV color space is mainly represented by three components: hue (H), saturation (S), and value (V). The V component represents the brightness of the color. The corresponding value range is [0,1], reflecting the maximum value of R, G, and B components of each pixel within the image in the RGB color space. The expression of V is provided by:  
\[V=\max(R/255,\,G/255,\,B/255). \tag{4}\]  
Specifically, R, G, and B correspond to the gray values of the red, green, and blue channels in the images. Let us evaluate the RGB value of each pixel in Figure 4a according to Equation (4) and present the calculation result for an image with the corresponding brightness image (see Figure 4b). The image with a depth of 0.5 m is divided into 50 equal-height image bands with equal spacing of 10 mm. The highest lightness value \(V_{i}\), maximum on each image band, is calculated, and location \(C_{i}\), pertinent to \(V_{i,\max}\), is marked, where \(C_{i}\) represents the \(C_{i}\)-th pixel point on the image band. Sequentially, positions \(C_{i}\) of the highest brightness on the adjacent image belt are connected to form the bright position change curve on the borehole unfolded image, as demonstrated by the red line in Figure 4c. If the lightness value before the \(j\)-th pixel in the \(i\)-th image is represented by \(V_{i,j}\), the cosine enhancement function in combination with the eccentric image acquisition model could be established to form the preprocessed image. Therefore, the lightness value of the \(j\)-th pixel in the \(i\)-th image (\(\overline{V}_{i,j}\)) is expressed as follows:  
\[\overline{V}_{i,j}=V_{i,j}\cdot\left[1+\lambda\cdot\left(\cos\left(\pi+\frac{ 2\cdot(j-j_{i,\max})\cdot\pi}{N}\right)+1\right)\right], \tag{5}\]  
where the enhancement coefficient \(\lambda\) could be adjusted according to the actual situation, \(J_{i,\max}\) represents the location of the lateral pixels associated with \(V_{i,\max}\), and \(N\) denotes the total number of lateral pixels in the image band.