| Detecting the defects on the surface of glass tube is essential for the industrial production of medicine bottles.Simultaneously,the requirements for glass tube defect detection have become stricter,which means rapid detection based on high accuracy and low cost.Therefore,a defect detection method based on GPU(Graphics Processing Unit)is proposed in this paper.It can greatly improve detection accuracy and speed with a little bit increase of the cost.In this method,three serial image processing algorithms are remoulded by a parallel program under CUDA(Compute Unified Device Architecture)architecture.The three serial algorithms include morphological filtering(erosion and dilation),edge detection(Gaussian filter,gradient and direction angle calculation,the non-maxima suppression and hysteresis threshold connecting edge)and thresholding processing(Otsu binarization).Because of the parallelization of these three algorithms,the running time of image processing algorithm is significantly reduced.According to the experimental data,the operational efficiency of the method adding GPU is about 16 times of that using CPU only,and at the same time,they have nearly the same detection accuracy.In more detail,the efficiency of morphological filtering increases nearly 14 times,the efficiency of edge detector increases approximately 15 times,and that of Otsu binarization processing increases nearly 9 times.Therefore,the image processing algorithm implemented via adding GPU can greatly reduce the system running time,and greatly improve computing performance in the defect detection system. |