In aircraft production process, people become more and more stringent on the workpiece quality requirements. This is due to having the crucial effects from the quality of the workpiece on the aircraft firm degree, flight performance, safety factor, service life and so. And the aircraft structure and skin are connected and fixed by rivet, due to the production technology, a portion of a surface of the rivet will appear defects, such as cracks, folding, Ma Hang, gap. However, the conventional manual testing is not only a high cost, but also low efficiency. Aiming at this problem, this paper designs a set of real time on-line automatic detection system for the surface defects and geometric dimensions of the rivet.The system uses Germany IDS black-and-white face array CMOS industrial camera and Gigabit Ethernet, homemade LED ring light source and backlight source as the image acquisition part; Industrial computer as the hardware platform of image processing and analysis. Software processing part, using Microsoft Visual Studio 2010 visual programming software, using computer vision library OpenCV as software development platform, conducting the second development on combined with machine drive and the SDK.The specific work of this paper is as follows:1,According to the needs of the project and combined with the characteristics of the measured workpiece, participate in the whole design of the system. On the basis of this, study the image acquisition system:camera selection, selection and manufacture of light source, lighting options.2,Image processing section, the first process the image by filtering, and then adaptively calculate the interesting region of the image, and finally cut. On the basis of this, design acquisition algorithm of different threshold value needed by image segmentation, conduct binarization segmentation for the workpiece image by using the threshold value of automatic selection, realize the automatic extraction of various defects.3,Conduct to search and analyze the contour of two valued image. on the basis of a large number of experiments, formulate the criteria of discrimination of the outline. Through the Hof transform, find out the boundaries of the two values of the image and calculate the geometric size of the image.4,Conduct to simulate the detection algorithm in Matlab, and then transplant to the programming environment, and constantly improve the software part of the system.5,Use VS2010 platform to write the client application, build the MySQL database server, and design the corresponding data table used to store all kinds of data. After the system was built, its corresponding functional tests were carried out. |