Primary fractures significantly impacted the stability of surrounding rock in underground projects. Therefore, it is vital to find a solution for the problem of performing a non-destructive detection of rocks and extracting the internal three-dimensional (3D) data field of rocks for visualization analysis. To address this problem, this paper proposed a method of 3D reconstruction for complex cracks in deteriorated sandstone and developed a program based on MATLAB. This work carried out image recognition on the CT scan images of deteriorated sandstone, then implemented a surface reconstruction technique based on object cross-section information, a contour reconstruction technique based on object contour information, a point cloud reconstruction technique for extracting point cloud data of internal cracks in deteriorated sandstone, and a Graphical User Interface (GUI) control system that combines these three reconstruction techniques. The results showed that the 3D reconstruction techniques and the GUI control system proposed in this paper were capable of precisely marking the location of the cracks on a 3D coordinate system and accurately describing their shape with a vector. With only 10 CT scan images, the point cloud reconstruction technique constructed the digital core, and the digital core can quantitatively characterize the influence of primary fractures on the stability of surrounding rock. Additionally, the calculated results of the proposed method were very close to that of Avizo. This method realized the visualization and quantitative characterization of the internal structure of rocks and offered a model for analyzing the stress-fracture-seepage field change during excavation.