| Because of its unique and effective screening method, color sorting apparatus is widely used in sorting and processing industry of rice and other foodstuff. At present, our country lags behind some foreign countries in the technology of color sorting apparatus, most manufacturers have to rely on expensive imports of foreign products. Therefore, for china, a large agricultural country, it will bring great economic and social benefits to develop our own color sorting apparatus, and use it widely in food processing and other industries.Based on the sorting processing of the color sorting apparatus, an image data acquisition device is built by the use of PCI data acquisition card and the color line CCD camera. And by operating the device through a control interface programmed by VB, the image data of different rice array are acquired, and the sampled data are stored in text files form, as a data source for the study of color-based sorting algorithm followed by.By the research and analysis of each frame of the image data, we find that the high frequency noise in the image date has a greater impact on the feature extraction of the bad rice. In order to reduce or eliminate this disturbance, the paper attempts to get smooth signals by wavelet filtering method. And according to the relevant theory of digital image processing feature extraction and actual image data characteristics, the k-means clustering analysis is applied to sorting the image data into three categories: the background category, normal rice category and the bad rice category, to get the purpose of extracting the bad points off the image date.Different from the principle of existing color sorting algorithms, this algorithm does not rely on any artificial operation or transcendental value, but directly determines which category the bad rice particle should be in, by the clustering algorithm based on the internal features of the data.Finally, we use 3600 frame image data collected from 20 groups of different rice to test the algorithm. The analysis of entire experimental results shows that the algorithm is practical and effective. |