The dehiscence of the Xanthoceras sorbifolium (X. sorbifolium) may lead to seeds jump out and economic loss. The shape and the degree of the crack will provide the relevant elements for the study of the X. sorbifolium dehiscence and duly picked. Therefore, an improved level set method is proposed for X. sorbifolium crack segmentation. The problems of intensity inhomogeneity and so on, which pose challenges for accurate crack segmentation. The local Gaussian distribution fitting method has a good segmentation effect, but it is sensitive to the initial contour and does not use gradient information, which affects the accurate location of the edge. Aiming at the above problems and the scene of crack segmentation, this paper firstly adopts histogram threshold method to obtain the initial contour automatically. Secondly, the energy function is constructed by combining local and edge information. Finally, the double‐well potential function is used to reduce the oscillation and distortion of the method. In this paper, the experiment results show that the average boundary precision is 88.25% and average segmentation time of each image is 12.7s of the proposed method. After comprehensive analysis of IoU and boundary recall, the method in this paper achieves better results.