*2.2. Prototype*

To verify the potential of the prototype, an advanced boom equipped with the camera was realized before the complete rover, to test the sprayer while varying all the considered parameters, and therefore to validate the reduction of the pesticide usage. In this paper, the detailed design of the advanced boom and the results of its validation are reported, before any industrialization step. Focusing on advanced boom validation instead of the full system, allowed to manage properly the basic functionalities. In particular, the prototype detailed in this paper includes:


The CAD model (Figure 1) shows the design and the overall structure of the test bench manufactured for quantitative evaluation of the proposed solution.

**Figure 1.** CAD model of the prototype.

## *2.3. Field Tests*

The main goal was to test the prototype in different working conditions considering various operating parameters, to find the most suitable spraying setting in given crop conditions. Two test sessions were carried out, as the pesticides are distributed at different stages of the plants' growth. The height and the width of the salad leaves were taken into account as representative of the crop. In detail, the parameters investigated were:


A total of 37 tests were carried out, arranging different combinations of the shown features. To check the amount and evaluate the spraying features, 75 water-sensitive papers were used for each test; the sensitive papers were placed in the crop in predefined ways, and after each run collected and analyzed. A depth camera was used to record each test and an image processing algorithm has been implemented to identify the plants and measure height and covered area.

For the tests, radicchio (*Cichorium intybus* L.) was selected as the main crop, being representative of most used salads in the ready-to-eat salad sector.

#### 2.3.1. Real-Time Measurement of the Plants' Features

The camera used for the tests is the Intel RealSense™ Depth Camera D435i [12]. Apart the relatively low cost (about 200 \$), this model allows at the same time to measure distances and to collect images; moreover, this specific model is equipped with an integrated IMU sensor. The algorithm for image processing has been implemented in C++ via the RealSense library [13], as it contains all the functions needed to use the camera.

The algorithm structure for image processing implements a classical pipeline. At first, some filters [14] are defined and applied to the data acquired by the camera, to reduce the noise and improve image quality, as follows:


After data acquisition and filtering, color detection and segmentation algorithms were used to find the plants. The OpenCV library [15] has been used to implement a simple algorithm [16] assuming, in a greenhouse scenario, the most common salad color is in the range of green, while the terrain is typically earth brown. Based on this simple assumption, it was necessary to find the right range of greens to detect the plants; although a possible solution could have been to work in the red, green, and blue (RGB) domain [17], since the frames were already in this format, the color values of this domain are extremely sensitive to light intensity, and therefore the best option was to convert each frame into the hue saturation value (HSV) domain [18]. Once the RGB frame is converted into HSV, a binary mask is computed to find where a specified color is.

As the tests were not conducted in a greenhouse, the assumption on the contrast between the salads' and the terrain's colors was not valid, and we had to tune the range also considering the background of the images, containing grey (the floor color). Due to some reflection, this grey area in the HSV analysis presented some "yellow" components, very close to the "green" part of the HSV spectrum; the choice of a proper threshold turned in to exclude some parts of the salads not to detect erroneously the ground. For real applications in greenhouse this should not happen, because of the clearer distinction between the color of the terrain and the salads.

Knowing where the plants are, it is possible to extract useful information like the height of the plants, from the depth component of the camera, and the percentage of the covered area. To work in real-time, some additional information on the plants is needed; indeed, to reduce the computational power of the algorithm and increase the throughput, the analysis is performed on a smaller area of the frame chosen in the middle of the frame, with a height which is one eighth of the total height of the image and a width that is two-thirds of the frame width. In Figure 2, the red rectangle identifies the plants detected, while the blue one indicates the area analyzed. Assuming the plants we want to analyze are in the middle of the frame, the algorithm measures the distance of the floor/terrain using a strip to the left and a strip to the right of the area under analysis. In doing this, all the "green" pixels are discarded, while the other measures are stored in a vector. The same process is done also for the plants: the algorithm considers all the pixels that are in the intersection of the area under analysis (the blue rectangle) and where the plants are identified; if the pixel is green, the distance is stored in another vector.

Having two vectors, respectively, for the distance measurements of the floor and the distance measurements of the plants, we compute the floor and plant distances using the median of the available samples as the mean would have been too sensible to the presence of several outliers. In a greenhouse scenario, the availability of these two values is sufficient to compute the median height of the plants in the area taken into account for the analysis. During the laboratory tests, the plants were placed in some trays, thus, the algorithm measures the height of the plants as:

median\_plant\_height = median\_floor\_distance − median\_plants\_distance − trays\_height (trays\_height = 0.06 m).

> The vision algorithm measures also the percentage of the analyzed area covered by the plants counting the number of green pixels recognized as plants and computes the ratio between this number and the total number of pixels inside the area. This last method uses 2D information, thus it does not extract volumetric characteristics of the plants.

**Figure 2.** Image processing algorithm output.

2.3.2. Evaluation of the Spraying Quality and the Amount of Spray Liquid (Water) Used

Seventy-five square-shaped water-sensitive papers of about 1 cm<sup>2</sup> area were placed on the upper surface of leaves (25 samples), on the lower surface (25 samples), and on the ground (25 samples). Salads were planted in eight bedding plant trays, each containing 6 × 8 smaller trays, each of them containing a plant. The dry water-sensitive papers were gently stuck to the plant leaf using a natural glue, and these remained there after the end of the treatment (i.e., the passage of rover with spraying water on the eight trays), including the time needed for the plants and papers to become dry again.

To perform a more systematic analysis and obtain quantitative results, the samples were classified and then attached to a blank A4 paper for image processing. A dedicated algorithm was used to extract every single water-sensitive paper and to perform the color analysis.

Dry water-sensitive papers are typically yellow, but when completely wet become blue. The parts of papers not well sprayed become light blue. The image processing algorithm is able to detect pixels with sufficient color saturation, meaning that they are close to the blue threshold value, defined from the sample of scanned papers. Since the samples were not perfectly squared and their area was not exactly 1 cm2, and during gluing them on white A4 paper they could not be perfectly aligned, the image to be processed also needed detection of all other nonwhite colors (Figure 3). This way, a few parameters were introduced, defined for every single extracted water-sensitive sample:


• d = -(*Xc*,*blue* − *Xc*,*total*)<sup>2</sup> + (*Yc*,*blue* − *Yc*,*total*)<sup>2</sup> is the distance (offset) between the two geometric centers defined above; the lower the value, the more centered spraying is performed.

**Figure 3.** Some examples of single water-sensitive papers extracted by extraction algorithm (on the left in each pair) and black and white images obtained after transforming all 'blue pixels' to 'black' (on the right in each pair).

The final output of the water-sensitive papers analysis algorithm is a report containing the following parameters for each test and each region (specific position—upper leaf, lower leaf, ground):


Another important aspect of the analysis is the amount of mixture (water) distributed. It can be estimated, knowing the flow rate of each nozzle, the speed at which the rover moves and, to refer to the area covered, the distance between the nozzles. Such quantity, called "coverage", is defined as

$$C = \left(\frac{l}{ha}\right) = \frac{Q}{v\Delta s} \times 10^4\tag{1}$$

*N*

∑

where: 


<sup>Δ</sup>*s*(*m*) is the distance between the nozzles.

> To calculate the flow rate, the following equation is adopted:

$$Q = \text{const.} \times \sqrt{\Delta p} \,\tag{2}$$

where:

Δ*p* is the differential pressure between the pressure of fluid inside the nozzle and ambient pressure; this differential pressure is directly obtained from the sensor.

Using table data for the flow at Δ*p* = 300 *kPa*, it is possible to express:

$$Q(\Delta p) = Q(\text{300 kPa}) \times \sqrt{\frac{\Delta p}{\text{300 kPa}}}.\tag{3}$$

For choosing the optimal set of spraying parameters, both the following conditions should be met:

• Average coverage *c* (%) should be acceptable (not too low, and with no or very few insufficient papers, Figure 4).

• Coverage in liters per hectare *C Lha* should be as low as possible.


**Figure 4.** Degree of coverage of water sensitive papers [19].

It is intuitively clear that these parameters are, roughly speaking, inversely correlated.

#### **3. Results and Discussion**

The results of all the 37 tests are shown in Tables A1 and A2 (Appendix A) and analyzed according to the different parameters defined in the previous section: *Nsuf ficient*, *Ninsuf ficient*, *c*, *σc*, *d*, *σd*, *C*. Columns are defined by these parameters, and for each test three rows were reserved for upper leaves, lower leaves, and ground.

Results for the water-sensitive samples collected from the ground showed that the spraying was carried out in all conditions at an almost complete coverage, thus suggesting not to focus on this information. This was expected, so the third ('ground') row of each test put in the table is not significant.

After applying the criterion for the number of "insufficient papers", only 10 tests remained for further consideration, which accounts for roughly 250 samples. The mixture (water) amount ranged from the very promising value of 265.5 L/ha to standard treatment of 957.6 L/ha (i.e., very close to the theoretical 1000 L/ha). Considering this work aimed to show the possibility to reduce significantly the pesticide distribution while maintaining good or even improving spraying results, it has been decided to go deep only in those tests involved in a distribution of less than 500 L/ha. The relevant results are shown in Table 1; to offer full insights, in Table 2 all the parameters affecting the results are shown.

**Table 1.** The selected results from the first (nos. 9, 13, 14) and the second test session (nos. 17, 21, 24, 27, 34).



**Table 2.** Parameters from the tests 9, 13, 14, 17, 21, 24, 27 and 34.

1 pulse width modulation.

In Table 1, some runs show a slightly higher standard deviation *σc*. Although they have very good coverages *c*, these values may sugges<sup>t</sup> that by repeating the tests with the same parameters different results (possibly worse) could be obtained. To select the optimal parameters, we could have used the simple index of performance defined as *η* = *cC* could have been used. Although this makes sense as it represents the percentage coverage *c* (%) reached with a certain amount in L/ha, it is necessary to consider that the variance plays an important role. For this reason, we excluded to the time being very promising results (i.e., less than 300 L/ha) as they need further investigation.

Staying on the safe side, we can reliably state that with 420–470 L/ha it was possible to obtain excellent coverage of upper and lower leaves in both test sessions (for example, tests nos. 9 and 14 from the first session, with an average plant height of 7 cm and test no. 24 from the second session, with an average plant height of 14 cm).

Considering a theoretical mixture amount of 1000 L/ha, these numbers show that it is possible to optimize spraying parameters with a reduction of more than 50%. Going down to less than 470 L/ha, coverage results are however excellent, and still remain promising opportunities to reduce the usage below 300 L/ha, starting from the parameters of tests nos. 27 and 34 (Table 2).
