Detecting underwater cracks in ocean engineering structures is crucial for their maintenance. Research on deep learning methods based on computer vision for crack detection has become a hot topic recently. Datasets have a significant impact on the accuracy of deep learning networks, however, datasets for underwater environments are extremely scarce due to conditional difficulties. Therefore, this paper artificially made concrete crack test blocks and took underwater images. The denoising diffusion probabilistic model (DDPM) was used to expand the dataset to increase the number of images to support neural network training. In the dataset, blurry images affect the recognition efficiency due to insufficient clarity in the underwater environment. To solve this problem, this paper adopts the wavelet transform combined with the histogram algorithm for image enhancement. This paper proposes an improved YOLOv8 network to recognize these crack. Compared with the YOLOv8 series network, it has the advantages of both accuracy and model size. The network is lighter, and it has a good effect on underwater image recognition. Moreover, to get the crack data information, this paper uses the skeleton extraction of the underwater cracks and the curve fitting method for the measurement.