Benoit De Mezzo
email: benoit.demezzo@cemagref.fr

Gilles Rabatel
email: gilles.rabatel@cemagref.fr

Christophe Fiorio
email: fiorio@lirmm.fr

Weed leaf recognition in complex natural scenes by model-guided edge pairing

Keywords: Leaf recognition, Bézier curve, deformable template, shape models

New weeding strategies for pesticide reduction rely on the spatial distribution and characterisation of weed populations. For this purpose, weed identification can be done by machine vision applied in the field. Due to the scene complexity, a priori knowledge on the searched shape is valuable to enhance the image segmentation process. We propose here an approach based on a primary analysis of object boundary pieces in the image. This analysis relies on shape modelling, and leads to the generation of hypotheses about actual leaves in the scene. First results are presented, and further developments are proposed.

Introduction

In order to improve weeding strategies for pesticide reduction, the characterisation of weed populations (spatial distribution, species, growth stage, etc.) is of primary importance. Therefore, many research studies have focused on weed population characterisation by machine vision [START_REF] Woebbecke | Plant species identification, size, and enumeration using machine vision techniques on near-binary images[END_REF][START_REF] Zwiggelaar | A review of spectral properties of plants and their potential use for crop/weed discrimination in row-crops[END_REF]. However, difficulties remain due to outdoor scene complexity and biological variability of plants. Introducing a priori knowledge on the searched shape can enhance the image segmentation process. In [START_REF] Manh | Weed Leaf Image Segmentation by Deformable Templates[END_REF], a method was developed that searched for leaf tips and then tried to adapt deformable templates to isolate weed leaves. Templates were fitted to leaves in the image using evolution forces based on image colour data. This method has shown its ability to recover partially occluded leaves. However, some problems occurred in template fitting when the initial position was very far from the desired one: the template initialisation on leaf tips did not use all the available information, such as object boundaries. We propose a shape-guided approach based on a primary analysis of object boundary pieces in the image. Its objective is to generate primary hypotheses about the leaves present in the scene, in order to initialise flexible templates more efficiently. The analysis is helped by a priori knowledge introduced as shape models. Several models can be defined to match various species. The general process is illustrated in Figure 1.

i ) As a first step, reliable discrete pieces of contours (or 'strong boundaries') are extracted by low-level image analysis. Then, these boundaries are encoded, using Bézier curve identification, in order to facilitate further analysis.

ii ) Next, a matching process is applied to these strong boundaries, which looks for model hypothesis assignments. It includes a reinforcement stage, which searches the possible correlation with other strong boundaries and previously built hypotheses, as well as a final voting process to select the best hypotheses.

iii ) Finally, remaining hypotheses are used to initialise deformable templates, as described by [START_REF] Manh | Weed Leaf Image Segmentation by Deformable Templates[END_REF]. This last step will provide a conclusive confirmation of the hypotheses and of the segmentation accuracy. This paper describes the first developments of this method applied to the particular case of mono-cotyledon leaves (oblong and symmetric). It covers the first step described above and a part of the second one.

Methodology

Image segmentation and strong boundaries extraction

A segmentation method based on the Union-Find algorithm developed by [START_REF] Fiorio | Two linear time Union-Find strategies for image processing[END_REF], is used to extract boundary information. An example of Union-find processing is illustrated in Figure 2. It results in a set of homogeneous colour regions.

Bézier identification

After this extraction step, a Bézier identification method is applied to the selected contours (the Bézier representation is also used for shape models). Bézier curves of 2 nd degree were used because they have convenient geometrical and mathematical properties and can be adapted to the searched shapes. These curves allow simplifications when matching them each other, compared with straight lines and arc coding. These curves are only defined by three 2Dpoints, combined with Bernstein 2-order polynomial coefficients (Figure 3). The coordinates of each point M(t) of a Bézier curve can be computed using t  [0, 1] and 3 control points P 1 , P 2 and P 3 by: M(t) = (1 -t) 2 P 1 + 2 t(1 -t) P 2 + t 2 P 3 Notice that the tangent at M(t) can be recovered considering the two points: Because such Bézier curves cannot fit every shape, we first have to split the extracted boundaries into several segments showing a smooth curvature and a constant curvature sign.

M 1 (t) = (1 -t) P 1 + t P 2 M 2 (t) = (1 -t) P 2 + t P 3 , with: M(t) = (1 -t) M 1 (t) + t M 2 (t)
To do so, the discrete contour is first smoothed using a Chen filter. Then the absolute angle value and its first and second derivative are computed at each point. With this set of information, we search for inflexion points and high curvature points, because 2 nd degree Bézier curves can not correctly fit this singularities. Constant curvature segments (straight lines and circular arcs) are also detected. This information will define start and end points of curves (Figure 4-c). A geometrical identification has been preferred to iterative mean square error minimisation methods for processing time reasons. Two of the control points (P 1 and P 3 ) are on the curve (start and end). To compute P 2 , we look for the point M on the curve which is the farthest from the segment [P 1 P 3 ]. This point nearly corresponds to the parameter value t=0.5. The point P 2 is then computed by: P 2 = 2*[D M], where D = 0.5*[P 1 P 3 ] (see illustration in Figure 5). A final adjustment is made based on the resulting identification error observed on two significant points (t=0.25 and t=0.75). To assess the identification accuracy, the mean square error between the discrete boundary to identify and its Bézier representation is calculated. Wrong identifications are rejected. Bézier curve pairing This step allows the determination of the boundary segments that are close enough to be gathered in a unique Bézier curve. This is done to reduce the effect of contour detection artefacts, and to recover continuous boundaries that have been disconnected by other small objects. Possible pairs are selected with respect to their proximity, length and curvature. Mean square error of their previous identification is also taken into account.

Start and end points of the combined curve are provided by the farthest points of the two initial curves. The middle point is obtained by computing the intersection of the start and end points tangents. As in the previous case, a final adjustment is made based on the observed error on some significant points of the global curve. Finally, the percentage of coverage of the generated curve by the initial ones is checked, as well as the mean square error between them (Figure 6). Erreur ! Des objets ne peuvent pas être créés à partir des codes de champs de mise en forme.

Model hypothesis generation

Model representation. Models are defined as a set of 2 nd degree Bézier curves to represent the contours of the leaf shapes. In the present study, models includes only two curves (oblong leaf). Tolerance values are associated with control points to permit some adaptability according to the diversity of leaf shapes. Control points variations are not independent. We consider for our model the following types of variation: i) position, ii) orientation, iii) scale, iv) bending. The bending is managed through a virtual leaf vein curve, with two degrees of freedom. We also define the list of all the angles between two consecutive curves in the model with their associated tolerance interval.

Model matching initialisation. Matching a unique boundary with a model curve leads to an infinite number of solutions (in terms of scale and position). Thus, we used two close boundaries (linked or not) to start the model matching process and generate primary model hypotheses. A hypothesis needs some checks to be generated and considered as valuable. At first, to verify if a matching could be performed between two initial curves (a and b) and an existing model, the angle α formed by a and b is compared with possible angles in models. At this stage, position and orientation of the model are fixed. Then the matching of a and b with the curves belonging to the model angle found is verified. This verification is done by searching the best model scale and deformation, i.e. the ones which minimise the associated mean square error between the initial curves and the model. This search is made by applying alternatively stepwise variations on both parameters. This step is repeated for every boundary pair candidates, leading to a set of primary generated hypotheses. Notice that to generate our hypotheses, we use close boundaries (a and b) that are not necessary linked. Therefore, we can detect a leaf tip that does not appear in the image. So we are able to generate a hypothesis for a leaf that is overlapped by another one.

Model hypotheses reinforcement. After the hypothesis generation step, a reinforcement stage is carried out, in order to improve the fitting of correct hypotheses. It operates by searching the possible correlation between an existing model hypothesis and additional boundaries. These new boundaries are considered according to their distance to the current model shape. As previously, iterative variations of scale and deformation parameters are applied, in order to minimize the total square error for all the involved boundaries. This reinforcement step allows hypotheses to be readjusted (scale, orientation, bending). Different new hypotheses can also be generated from the same one, depending on the additional contours considered. Notice that a boundary can be attached to several hypotheses. Therefore, a score is attached to each boundary for further use. This score is inversely proportional to the number of attached hypotheses. This step is repeated until there is no more hypothesis modifications.

Voting process

The objective of this step is to select the best hypotheses from above. For this purpose, a score is computed for each hypothesis, as the sum of the score of all attached boundaries (see above). Other criteria can be added, such as the rate of perimeter covered by boundaries, the matching quality, etc. A sorted list of hypotheses is then established using this score. Finally, the sorted list is scanned starting from the best score: the current hypothesis is retained, and other hypotheses sharing the same boundaries are removed from the list.

Materials

Colour images of weed scenes were collected from experimental plots at the Institut National de la Recherche Agronomique (INRA), in Dijon (France). In this paper, only one weed species, green foxtail (Setaria viridis) was studied, with a leaf stage of 4 or less. A digital camera with flash, associated with a scrim, has been used to limit light contrasts. The image resolution is about 125 µm/pixel. Tests have been made on 10 different images, i.e. about 50 plants. The algorithms have been implemented in C++ language.

Results

The results presented in this paper do not include the reinforcement stage and the voting process, which are still under development. For the 10 images tested, about 60% of the leaf tips have been correctly associated to primary model hypotheses (see "Model matching initialisation"). Cases of overlapped leaf detection have also been observed. An example is given in Figures 8 and9. Figure 8 shows the selected pairs of boundaries and Figure 9 the primary hypotheses associated to these pairs of boundaries, before the reinforcement stage. The next reinforcement stage should improve hypotheses accuracy and give a better fitting. Currently, some problems are linked to missing or misplaced boundaries due to the inaccuracy of the contour extraction step. Thus, we still need more robust segmentation and extraction methods to improve our result.

Discussion and Perspective

We are currently working on the reinforcement stage and the voting process, as well as on the reliability of the contour extraction (checking of the image gradient under each detected contour and smoothing). This should allow us to build stronger hypotheses and test the robustness of the method on various images. In addition, iterations of the complete method with less and less strict parameters will be implemented, each step bringing new strong boundaries and then new hypothesis reinforcements.

Finally, the best model hypotheses will be used to initialise deformable templates in an iterative adjustment process, as described by [START_REF] Manh | Weed Leaf Image Segmentation by Deformable Templates[END_REF]. This last step will provide a conclusive confirmation of the hypotheses, and segmentation accuracy compliant with further pattern recognition (e.g. species discrimination).

Figure 1 :

 1 Figure 1: Recognition sequence.

Figure 2 :

 2 Figure 2: Segmentation example with Union-Find / Scanline method (left: initial picture / right: segmented picture).

Figure 3 :

 3 Figure 3: Bézier curve definition.

Figure 4 :

 4 Figure 4: Boundary extraction and identification a: selected regions -b:boundary segments -c: Bézier curves (light grey: end-start point / dark grey: middle point)

Figure

  Figure 5: Bézier identification method.

Figure 6 :

 6 Figure 6: Examples of Bézier curves pairing (Light grey: normal or initial curves / dark grey: paired curve)

Figure 8 :

 8 Figure 8: Strong boundaries attached to a hypothesis.

Figure 9 :

 9 Figure 9: model hypothesis representation.