With the rapid development of 3D printing technology,internal flaw detection is an important method for quality assurance.With the development of image processing technology and machine vision,the use of intelligent methods to identify internal defects has become a research hotspot.In this paper,the gun drill 3D printing defect image as the research object,the defect image recognition methods were studied,aiming at using various methods to achieve better performance indicators of defect image recognition,so as to improve the recognition rate of defect image.In this regard,the main work of this paper is as follows:Based on the characteristics of noise and low contrast of the defect image in gun drilling laser 3D printing,the preprocessing is carried out,including image denoising and image enhancement.Spatial filtering and frequency domain filtering are used in image denoising,and the results show that the adaptive median filtering with a maximum template size of 3 has better effect.At the same time,the linear transform gray enhancement method is determined in the image enhancement,which can make the image gray distribution and stretch and keep the shape of the original gray histogram.In order to better highlight the target defects,the defect image is segmtioned,including threshold segmentation,edge segmentation and region growth segmentation.In the region growth segmentation algorithm,the active contour image segmentation based on the region "Chan-Vese" method has better effect.Then the gray co-occurrence matrix was used to extract texture features,and 10 eigenvalues were obtained.The principal component analysis method was used to reduce the feature vector to 5 dimensions,and the normalization process was carried out,which eliminated the large difference in order of magnitude.Finally,the neural network theory is studied and the defects are classified and identified.The genetic algorithm and sparrow search algorithm are introduced into BP neural network,and the two algorithms optimize the weights and thresholds of BP neural network,which significantly improves the classification accuracy.In the deep learning algorithm,Le Net-5 and Alex Net convolutional neural networks are adopted to eliminate the complexity of manual feature extraction.The classification accuracy of Alex Net network is 97.4%,which can realize accurate defect recognition. |