| At present,the production of chinese medicine is more and more mechanized,and the production efficiency is higher and higher.Tablets,however,in the process of processing and packaging are influenced by the complex factors,to produce medicine plate appear quality problem,for example: missing tablets,leakage of powder,interspersed with foreign object,damaged blister,etc.Therefore,quality testing of drug packaging is an important part of the pharmaceutical production process.Most of the pharmaceutical factories are using artificial test tablets for defects.But as workers will be affected by emotion,vision,environment and other factors,there may be problems with detecting errors,therefore,we cannot meet the demand for industrial automation.The drug packaging defect detection technology base on machine vision can overcoming the problem of manual detection,at the same time,it can dramatically improve the detection efficiency,lower cost of consumption.This paper mainly analyzes and studies the defect detection algorithm of the aluminum foam mask based on machine vision,on the basis of studying the theories and algorithms of drug defect detection,implement the packaging defect detection of the machine based plastic bubble wrap,and the algorithm of this paper is verified by experiment,the main research of this article is as follows:(1)Study of the blister drugs production process and the type of defects,and analyses the different types of defects,compared to other packing defects extraction method using fast and robust characteristics of SURF(Speed Up Robust Feature)algorithm for feature extraction of the image,the algorithm is invariant to scale and rotation,fast calculation speed,the accuracy rate is high,and the use of BoW(Bag-of-Word)model for image feature extraction to the processing,so characteristic of all images have a standard description,reduces the quantity and complexity,into training can get good classification effect in.(2)Due to the fact that the defective packaging can only get fewer samples,a large number of defect free samples,this paper uses one class support vector machine(one-class SVM)is used to eliminate the defect samples,so not only can solve the problem of obtaining defective samples,and a more complex classification problem is simplified to a two classification the problem,not only reduces the complexity of the algorithm,and improve the efficiency of detection,the detection speed detection system can meet the actual needs of the pharmaceutical factory.(3)In order to verify the detection effect of the drug packaging defect detection system developed in this paper,the experimental verification is carried out.The experiment tested the SURF algorithm,BOW threshold algorithm for visualdictionary word number of K,and one class support vector machine penalty factor C of various parameters such as the influences on testing results,and get the optimal parameters,the real vehicle test in drug testing equipment,it proves that the algorithm achieved satisfactory results in the detection speed and accuracy. |