Abstract Resistivity imaging logging has become a direct and precise method for visualizing the structural complexities of reservoir fractures and dissolution pores. The current use of Otsu's thresholding for segmentation results in poor segmentation quality and significant noise. Accurate segmentation of sub-images containing fracture and dissolution pore targets is essential for automated structure identification and subsequent parameter calculation. This study leverages the rapid convergence and robust global optimization capabilities of the Dung Beetle Optimizer to develop enhanced image segmentation approaches. Specifically, it introduces a refined K-Means algorithm for multi-category image segmentation and an Otsu algorithm for multi-threshold image segmentation, both optimized by the Dung Beetle Optimizer. Compared to conventional binary segmentation algorithms, this new algorithm effectively isolates noise and extracts multi-category information. Using the segmented sub-images, this paper integrates mathematical morphology techniques to compute parameters such as area, perimeter, tortuosity length, and pore shape factor for identified targets. Additionally, Principal Component Analysis is used to derive recognition factors for fractures and dissolution pores. Applications show that this factor can identify matrix, fracture, and dissolution pore targets in complex background images. By combining parameter information of the target area, the method effectively removes false information in resistivity imaging and segments sub-images of fractures and dissolution pores, calculating fracture area ratio, dissolution pore area ratio, and total area ratio.