# The Application of Computed Tomography to Study the Soil Porosity of Mountain Red Earth
## 2 Materials and Methods
### Image Processing  
After obtaining CT data of the soil columns, extracting the pores from the slices is crucial and involves several key processing steps. Typically, image processing methods such as image reconstruction, enhancement, region segmentation, and feature extraction are employed. CT data consists of multiple slice images. Image reconstruction algorithms are used to synthesize these slice images into 3D image. Initially, these algorithms enhance the CT images through a series of processes, including noise reduction, contrast adjustment, and edge enhancement. Subsequently, the regions of interest are segmented using a combination of thresholding and morphological operations [35]. The CT value of a substance represents  
Figure 3: CT scanning and CT data processing, including schematic and field view of CT scanning (**a**), original images of CT slices (**b**), and segmentation and 3D reconstruction of soil sample (**c**). its density, with different materials exhibiting different CT values. By utilizing the CT values of substances within the soil columns, it becomes possible to distinguish between particulate media and pore structures on the slices. This approach enables precise separation of materials based on their CT values. Based on detailed analysis of each slice at different depths within the soil columns from the original files, the CT values of the substances within the columns range from \(-1024\) to \(1837.6\) Hounsfield Units (HU). Upon thorough comparison and verification of CT slices, the CT values for soil pores range from-120-25(HU). It is important to note that the presence of abundant root systems significantly influences the formation and evolution of large pores within the columns. Additionally, the decay of roots forms continuous channels that play a crucial role in rapid water infiltration in slope soils [36; 37; 38]. For the purpose of this study, the root systems were not separated from the analysis; instead, they were classified together with the regions occupied by air as part of the pores. The maximum scanning dimensions of the soil sample are 26 cm \(\times\) 29 cm \(\times\) 33 cm (Figure 4a). Due to the manual cutting of samples during collection, there are unavoidable defects at the corners, resulting in an irregular shape. To eliminate the impact of these corner defects on the processing results, a specific outer region of the soil was removed, and a cubic soil column measuring 15 cm \(\times\) 15 cm \(\times\) 20 cm was selected as the object of study. Different colors were assigned to materials based on their CT value ranges, and the images were imported into Adobe Photoshop for cropping to obtain the 15 cm \(\times\) 15 cm area image. In this representation, red and black indicate the pores, while green represents the soil (Figure 4b). Threshold processing was then applied to convert the image into a binary image containing only black and white colors (Figure 4c). In this binary image, the soil matrix and gravel are displayed in white, while the large pores are shown in black. During the threshold processing of the images, the contrast of the CT images was enhanced using Adobe Photoshop by increasing the contrast settings to prevent the omission of smaller pore sizes during the binarization process. Finally, the resulting binary images were imported into ImageJ, where the particle analysis feature was used to obtain the number of pores on each CT slice, the corresponding area of each pore, and various information, including the roundness of each pore (Figure 4d). Figure 4: Processing of CT slices: (**a**) The original image from CT scanning. (**b**) Extraction of regions of interest. (**c**) Image after binary segmentation (black represents pores and white represents background). (**d**) The pores are extracted based on ImageJ. In this scanning, the distance between slices was 0.7 mm, resulting in a total of 290 CT slices for the soil column.