| Defect inspection is the important means to guarantee the safe use of parts, the traditional detection is completed by manpower which with big workload. It not only spends a lot of manpower, but also prones to error checking and missed detection, which has greatly limited the improvement of production efficiency and product quality.Therefore, carrying out the topic research has important practical value and social benefits.Having researched and analyzed various detection methods on surface defect detection of parts of the revolution in and abroad, machine vision inspection method is selected as the topic research method, which based on image processing. Using CCD camera as the parts detection sensor, which is used to collect the surface image of parts of the revolution solid and machine vision technology, use image acquisition card to put real-time images from CCD camera into the computer memory and do the image processing operation.In this paper the surface image of axially symmetrical parts as the research object.Firstly, we adopt the histogram equalization to enhance image contrast; Secondly,we adopt smooth filtering to eliminate noise for the collected image, according to research and compare the several kinds methods of smooth filtering, we use the median filter in this paper. Then the image is segmented to extract the defects. Compared the advantages and disadvantages of bimodal method, iterative method, Otsu method and maximum entropy method, we choose the Otsu method which was a adaptive threshold.For poor segmentation caused by uneven brightness problem, we put forward a new method where the image segmentation that based on top-hat transformation of mathematical morphology and Otsu are presented, it can realize the image segmentation.For a little of noise caused by the image binarization procession,We can adopt a method which removes connected domain of small area in image binarization procession to elimate the noise and to completely extract the defects.In the environment of VC6.0, we use the OpenCV software to program. Based on machine vision technology was carried out on the parts surface defect detection. It can not only improve productivity and guarantee the quality of products, but also improve the working environment of the workers, pull the workers out the first-line hard conditions,and achieve the liberation of productivity function. |