| With the development of modern industry in our country,the demand for glassware is increasing,and people’s demand for glassware is more and more high.The quality detection of glassware is especially important in glass production.At present,the quality detection of the major glass manufacturers in our country is mostly dependent on artificial detection,and the detection efficiency is low.The results of the detection are affected by human factors and high cost,and it is difficult to meet the needs of production.With the rapid development of computer technology,the technology of machine vision and pattern recognition is more and more applied to the field of industrial detection.In this paper,a glassware defect detection and recognition system based on machine-visual technology is designed to replace the traditional artificial detection system,which can improve the detection efficiency and accuracy.The main contents of this thesis are as follows:According to the actual production process and application environment of glassware,based on the basic principle of machine vision detection technology,a large number of documents are analyzed.The overall scheme of the system is designed,including the composition of the hardware system,the selection,the lighting scheme of the light source and the detection algorithm of the software system.This paper analyzed the causes and types of the process noise of glassware image,and designed the image preprocessing process of the glassware detection system.The weighted mean filter is improved,and an adaptive mask mean filtering algorithm is designed.Then the image is sharpened and enhanced,and the gray scale transformation and histogram equalization are used to enhance the glassware image from the two angles of the gray value linear mapping and the gray value dynamic stretching,which lays the foundation for the next step of the defect segmentation.This paper studied the detection and segmentation algorithm of glass dish defect,and analyzed the detection results of several different edge detection algorithms and the threshold segmentation algorithm,and improved the traditional edge detection algorithm.Combined with these two detection methods,the detection and segmentation of the detection defects can be achieved.Then the detection algorithm based on local fast Otsu is designed to detect the small defects,and the detection algorithm based on the wavelet transform is designed to detect the weak defects.The detection of the glass defects of the more difficult detection is realized.By analyzing the defect image,the feature extraction algorithm is designed.The 7 geometric feature parameters of the defect and the 7 Hu feature,which are composed of one-dimensional feature vector,are extracted.A defect classification algorithm based on feature threshold is designed,which is simple and convenient.In order to further improve the accuracy of classification,a defect recognition algorithm based on BP neural network is designed in this paper.By comparing the classification results of the two classification algorithms,and analyzing the defects of the algorithm based on the feature threshold and the advantages of the BP neural network,the system designed in this paper has finally chosen the classification recognition algorithm based on the BP neural network.The system is verified and analyzed,and the software detection interface is designed based on MFC in Visual Studio 2010,and the detection results are displayed. |