| Mechanical properties test of materials is important for studying the mechanical properties of materials and exploring the causes of fatigue cracks.Researchers need to detect the cracks and defects in real time when using tensile testing instruments to test the material properties.At the same time,the position of the test piece will change during the stretching process,so it is necessary to locate the position of the test piece in real time.Therefore,in view of the cracks and pitting corrosion and other defects in the tensile process of the test piece,the crack defect dataset is established in this paper,including 183 pictures in the single-classification crack defect dataset and 325 pictures in the multi-classification crack defect dataset,and the crack defect detection algorithm based on YOLOv5 target detection algorithm is carried out;The center mark dataset of the test piece is established,including 156 pictures in the cross mark dataset and 147 pictures in the circle mark dataset.The center mark detection model is trained,and the positioning algorithm is designed to study the center position of the test piece.Based on the comprehensive analysis of the research status of damage defect technology and target localization technology at home and abroad,this paper selects YOLOv5 algorithm to detect crack defects and center marks,selects appropriate industrial camera and industrial lens to build an image acquisition and detection system for crack defects and specimen marks,trains the crack defect detection model and verifies the detection effect;YOLOv5 algorithm is used to train the cross mark and circle mark detection model,and the center positioning algorithm of the test piece is designed to locate the center of the test piece.Combined with image processing algorithms,the crack contour is extracted,the crack length and width are calculated,and the crack detection image system is designed and implemented with PyQt5 tool which creates graphical user interface.In order to carry out crack defect detection research,surface defect images such as pitting,linear cracks and reticulated cracks are collected and labeled as datasets,and the YOLOv5 target detection algorithm is used to train the model on the crack defect dataset,and the crack defect detection effect is tested and analyzed,and the average detection accuracy could reach 95.4%,and for the problem of poor detection of small target defects,the main network structure of YOLOv5 target detection algorithm is improved,and the average detection accuracy is improved by 0.7%.In order to design the central positioning algorithm of the test piece,two positioning marking methods,cross mark and circle mark,are selected,and the cross mark central positioning dataset and circle mark central positioning dataset are established,and the model training of the dataset is carried out using YOLOv5 target detection network.The camera internal parameters are calibrated,and the center positioning algorithm of the test piece is designed based on the calibration result and the target detection result,and the center positioning test of the test piece and the positioning error analysis are carried out.In order to achieve the crack detection image system,the crack image is preprocessed and the crack contour is extracted based on the image processing methods such as grayscale,grayscale correction,image denoising,edge detection and morphology processing.The algorithm for calculating the actual length and average width of the crack is designed and the example is measured.The PyQt5 tool is used for the visual design of the crack detection system,which integrates image acquisition,crack detection,image processing,crack extraction,and crack size calculation functions,achieving automation and visualization of crack detection. |