Abstract:In view of the problems of complexity, low integration and multi-quality factors of egg sorting, an integrated inspecting and grading system of egg qualities was designed, which realized the automated inspecting and classification of the crack, size, freshness and quality level of eggs by using the machine vision algorithm. The designed system adopts pipelined structure which mainly consisted of an image acquisition unit, classification unit, transmission unit, image processing unit and micro-control unit. The image acquisition unit, classification unit, transmission unit were controlled orderly by the image processing unit and microprocessor unit, which were connected by the gigabit net port or the I/O joggle. Aiming at realizing the tiny egg cracks detection, the automatic threshold selection was presented based on the gradient magnitude histogram and maximum variance between clusters. Then, the cracked eggs were detected and identified, and eliminated in the classification unit I. In order to estimate the egg size, the maximum transverse diameter, maximum longitudinal diameter and the egg row index are measured by the minimum enclosed rectangle method. The eggs were sorted into two class of large and small in classification unit II. Through transforming the egg perspective images from RGB to HSI, the relationship between Haff value and the color components is analyzed. A back-propagation neural network is established to classify the freshness. Experimental results show that the accuracy of crack identification is 98.18%, the precision rate of special grade (AA) is 96.67%, the precision rate of grade A (A) is 98.31%, the precision rate of special grade B(B) is 96.67%, and the precision rate of egg quality recognition for different freshness grades is 97.48% generally. The designed system can be applied to online inspection of large-scale poultry and egg farms with high accuracy, simple structure and fast execution speed, as well as automatic inspecting and grading of other agricultural products.