| With the great development of economy and technology, the level of people's life has consecutively improved. At the same time, people have taken care of the quality of the capsule which keeps their bodies healthy more and more rigorously. In daily life, we can catch the capsule dosage, figure, color and luster by our eyes when we buy the capsule from the drugstore. According to these physical measures, we can estimate the capsule. But in the production process of drugs in many pharmaceutical factories, this method of checking the capsule's quality one by one can not meet the need of the modern productivity of the medicine manufactory. This will not only increase the production and management costs, but also can not be guaranteed to have a high pass rate of detecting, because people's eyes have many shortcomings such as the instability and the fatigability on the capsule detection processing. Based on this background, in order to make the detection equipments be more perfect and realize the better functions, this paper predicts the running way and requirements of the existing equipment first and then make use of the digital image processing technology to do the research on the core parts which including the designing of system hardware, the algorithm of the detection of defective capsule, the designing of system software, and the simulation of the algorithm by Matlab.For the hardware, in order to meet the requirement of running real-time of the detection equipment, this paper put forward a whole resolution scheme which is composed of DSP and FPGA on the capsule image detection system. The author studied the structure and principle of the CCD camera, the change of the video signal, the configuration of FPGA and the functions in the system, the extern interface of DSP, etc.For the algorithm of the capsule detection, the paper introduced the basic theory and the research method of the digital image processing technology. The grey system is applied in the digital image processing, and as the base of theory in the paper. Use AGO data generation and GM(1,1) model to design a filter algorithm. On the basis of digital image processing theory, analysis the characteristic of the capsule digital image in detail by Matlab, design an algorithm on the defective capsule detection. This algorithm makes use of the segmentation technology of histogram thresholding of the capsule's grey level image to calculate the area, mean and square difference. For the detection of the defective capsule's surface, the algorithm uses the HSI color model of the images to analyse and process the color images of the capsule. The difference of the distribution of H histogram and S histogram of images can be used to classify the capsule. The detection algorithm of the capsule which introduced in this paper is proved by emulator in the space of small sample.For the software, after knowing well about the whole image process domain, classify the running way of the system hardware and detailed analysis the functions design method of DSP and FPGA. A brief soft flow chart of system function is introduced. |