2 STATE OF THE ART
Several studies have been conducted on the cereal
seeds grading. In (Agustin and Oh, 2008), the au-
thors focused on the quality control of grain of rice,
regarding different criteria of shape and color. From
these criteria, a classification method based on neural
network is used to qualify each grain. This approach
gives good results for the classification of complete,
broken and colors defect rice grain. However this
method is applied on images with separated grain.
The segmentation issue is then simplified by an op-
erator or a mechanical system (vibrating bowl or slot)
to separate the grain in front of the camera.
Other studies have been conducted on the cereal
segmentation topic, mainly on wheat and rice. The
researches in (Yao et al., 2010) and (Faessel and Cour-
tois, 2011) focused on detection and separation of rice
grain. They both address the problem by working on
a binary image obtained by a threshold to separate the
objects from the background. In (Yao et al., 2010), the
authors then work on the contours and search the con-
caves angles to connect them two at a time in order to
detect objects boundaries. In (Faessel and Courtois,
2011), the authors used a mathematical morphology
method on the binary image: a skeleton operation on
the background. The open lines of the skeleton, with-
out ending, are then combined under some constraints
to obtain the objects boundaries. These two meth-
ods give good results on image of touching grain with
low density of objects. The computation times are
short, but these methods are not adapted for images
with heaps and high density of seeds.
3 ACQUISITION SYSTEM
The acquisitions are made in a cabin (Figure 1) which
integrates a camera and a lighting system. This cabin
offers stable and reproducible acquisition condition,
independently from the external lighting.
Some improvements have been made on the ex-
isting system available at the industrial partner Alpha
MOS. The lighting system and the camera have been
replaced by new material. The aim was to improve
the quality and the stability of the color image acqui-
sition. The lighting source retained is composed of
white LEDs. These LEDs have a continuous spectrum
in the visible range and were chosen for their stabil-
ity over time in term of luminous intensity. As LEDs
are punctual sources, a diffuser is placed downstream
to ensure the lighting homogeneity in the acquisition
area. The image acquisition is performed at a distance
of 400 mm from the object plan by a CMOS mono
(a) Original image. (b) Binarized image.
Figure 2: Binarization with Otsu’s method.
sensor color camera of 5 megapixel with a 5 mm lens.
The chosen camera was a Basler acA2500-14gc. It
offers a resolution on the object plan around 6 pixels
per millimeter, which is important for our application
as the objects have a size of only few millimeters.
The image acquisitions presented in this paper
were obtained with this system.
4 SHAPE LEARNING
A binary image can be obtained in many classical
different ways. For example, with rice seeds which
are well contrasted with a black background, Otsu’s
method (Otsu, 1979) can be applied, see Figure 2.
A background learning without any seed then sub-
traction could also be considered. In difficult cases, it
is possible for an human operator to choose manu-
ally correct thresholds for gray level images or color
images. He could also separate some pixels in two
classes and let a k-means clustering algorithm do the
rest (MacQueen, 1967). The binarization could also
be made using the image gradient.
From a binarized image of isolated seeds, the fol-
lowing features of each seed are extracted:
Area. It is the number of pixels inside the seed.
Eccentricity. It is a scalar, between 0 and 1, which
specifies the eccentricity of the ellipse that has the
same second-moments as the region. The eccentric-
ity is the ratio of the distance between the foci of the
ellipse and its major axis length. An ellipse whose
eccentricity is 0 is actually a circle, while an ellipse
whose eccentricity is 1 is a line segment.
Major axis length. It is the distance between the end
points of the longest line that could be drawn through
the seed. The major axis endpoints are found by com-
puting the pixel distance between every combination
of border pixels in the seed boundary and finding the
pair with the maximum length.
Minor axis length. It is the distance between the end
points of the longest line that could be drawn through
the seed while maintaining perpendicularity with the
major axis.
Perimeter. It is the number of pixels of the boundary.
DeterministicMethodforAutomaticVisualGradingofSeedFoodProducts
213