Optoelectronic color sorter is a typical high-tech equipment integrating light, machine and electricity, which makes full use of modern technologies such as optics, electronics and biology. Color sorting is a process of final quality control and quality enhancement in rice finishing, thereby removing yellow, black, red, and belly white and other defective grains such as tiny disease spots to improve the purity of the rice and the quality of the product. And competitiveness. By removing the heterochromatic impurities such as yellow rice and diseased rice in the rice, it can first enhance the competitiveness of the rice and stimulate people's desire to buy. Secondly, the elimination of impurities effectively reduces harmful substances such as aflatoxin in rice , Really improve the quality of rice, and enhance people's consumer taste. Therefore, the color sorting machine has become a key device for rice processing enterprises to improve product quality and measure their strength. More and more enterprises choose and apply it. The color sorting machine has a good development prospect and the market development is gradually mature.
S1: Extract the outer contour data of the particles; S2: Obtain the image area S1 surrounded by the outer contours of the particles; S3: Pass the image that is higher than the gray threshold and lower than the gray threshold through the second contour Line interval; S4: Obtain the ratio K of the area of the outer contour line of the particles to the image area in the second contour line; S5: Take the average value K of the ratio K of all particles, the error coefficient of the average value is L; The particles to be color-selected mixed with the specific particles are used to obtain an image of each particle through a CCD sensor and processed according to steps S1-S4. When the ratio K is between L, the particle is selected as Specific particles, otherwise particles that need to be rejected. The present invention obtains the distribution area of different gray values and obtains whether to select or eliminate according to the gray distribution characteristics of specific particles.