# Reduction of Pesticide Use in Fresh-Cut Salad Production through Artificial Intelligence
## 2 Materials and Methods
### Field Tests
#### 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\({}^{2}\) 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 \(\times\) 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 cm\({}^{2}\), 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:  
* \(N_{total}\) is the number of nonwhite pixels, i.e., the number of pixels in a 2D image representing the water-sensitive paper. * \(N_{blue}\) is the number of blue pixels, i.e., those pixels in the 2D image of the water-sensitive paper that represent parts of the paper covered by water. * \(x_{c,total}\) is the \(x\) coordinate of the geometric center of all nonwhite pixels in the 2D image. * \(y_{c,total}\) is the \(y\) coordinate of the geometric center of all nonwhite pixels in the 2D image. * \(x_{c,blue}\) is the \(x\) coordinate of the geometric center of all blue pixels in the 2D image. * \(y_{c,blue}\) is the \(y\) coordinate of the geometric center of all blue pixels in the 2D image. * \(c=\frac{N_{blue}}{N_{total}}\) is the coverage, can be expressed in percentage as \(\frac{N_{blue}}{N_{total}}\times 100\%\) indicates what percentage of the area of the water-sensitive paper is covered by water or, in more practical terms, sprayed well. Figure 2: Image processing algorithm output. * \(\text{d}=\sqrt{\left(X_{c,blue}-X_{c,total}\right)^{2}+\left(Y_{c,blue}-Y_{c,total} \right)^{2}}\) is the distance (offset) between the two geometric centers defined above; the lower the value, the more centered spraying is performed. 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):  
* \(N_{insufficient}\) is the number of insufficiently sprayed samples, i.e., those papers for which the coverage \(c\) is below the adopted threshold \(t=7\%\). The threshold value was adopted experimentally, after running the program for different values and comparing with the exemplary papers from reference [19]. * \(N_{sufficient}\) is the number of all other samples from the same test and region; in total \(N=N_{sufficient}+N_{insufficient}\leq 25\) is the number of papers in a single test, from a single specific region. * \(\overline{c}\) is the average coverage for the single test, defined as \(\overline{c}=\frac{\sum\limits_{c_{i}}^{N}}{N}\), \(c_{i}\) is the coverage of every single water-sensitive paper belonging to this test and region. * \(\sigma_{c}=\sqrt{\frac{\sum_{i=1}^{N}\left(c_{i}-\overline{c}\right)^{2}}{N}}\) is the standard deviation of coverage for the given test and region.