## 2 Materials and Methods
### Image Processing Method and Feature Extraction
In the spot separation method 2 (SSM2), BSM2 is used for the background separation but the threshold \(T_{h}\) is constant (\(T_{h}=30\)), since it was experimentally observed that this value is appropriate for most of the cases. In the SSM3, again BSM2 is used for background separation, but the spots are separated from the normal plant part using the gray histogram as shown in Figure 2.  
The gray or color histograms used in this application are defined as follows: Each position on the horizontal axis is the gray or color level. The value of the histogram in this position denotes the number of pixels that have this specific color level. In Figure 2a,\(c\), the gray histogram has been generated by all the pixels of each image with citrus leaves infected by _Alternaria citri_ or _Diaporthe citri_ (melanose), respectively. Figure 2b shows the gray histogram generated only by the pixels of the leaf used in Figure 2a (not the background). In this case, the background pixels have been separated using BSM1. Similarly, Figure 2d shows the gray histogram generated only by the pixels of the leaf used in Figure 2c and BSM2 is used in this case. In both cases, the large lobe in the histograms of the full image, that starts above the position \(\text{c}_{1}=100\), corresponds to the white or light gray background and the lower lobes correspond to the leaf and spot pixels. In SSM3 these areas are separated by estimating a local minimum \(T_{m}\). In Figure 2d, the local minimum is clearly the position \(T_{m}=50\). However, selecting the local minimum in Figure 2b is not obvious. In this case, there is a minimum at the position 45 and another local minimum approximately at the position 70. Several other local minima can be found but they are not taken into consideration since they are estimated in a window of 20-30 successive positions to avoid noise. The selection between the values 45 or 70 for the threshold \(T_{m}\) depends on how the start of the lobe is defined. If it is assumed that a lobe starts when the histogram value exceeds a minimum but not zero value, then \(T_{m}=70\) may be selected. In any case, the leaf pixels with gray level higher than the \(T_{m}\) value are assumed to be normal leaf and the rest to be lesion spots if the lesion is darker than the normal leaf. If the lesion is brighter than the normal leaf, then its spots are those with a gray level higher than \(T_{m}\). The efficiency of SSM1, SSM2 and SSM3 is demonstrated with two examples in Figures 3 and 4. Figure 3a shows the upper surface of a leaf infected by the fungus _Diaporthe citri_ of melanose. If SSM1 is used, then setting \(T_{h}\) = 20 leads to the most precise spot mapping as shown in Figure 3b. If \(T_{h}\) = 10, a part of the normal leaf area is marked as lesion (Figure 3c), while if \(T_{h}\) = 30 some spots are not recognized (Figure 3d). SSM2 leads to accurate spot mapping as shown in Figure 3e. However, SSM3 fails to recognize several spots. In Figure 4a an orange that is infected by the dematiaceous hyphomycete of _Pseudocrecospora angolensis_ is displayed. Now, if SS1 is used, the optimal value for \(T_{h}\) is 30 (Figure 4b). Again selecting a lower \(T_{h}\) value marks more normal fruit area as lesion (Figure 4c), while selecting a higher \(T_{h}\) value does not recognize all the lesion spot areas (Figure 4d). In this case, SSM3 achieves a better spot recognition than SSM2. Although selecting the preferable SSM may seem complicated, the user is assisted interactively by the developed application to choose the appropriate SSM. Figure 2: Gray histogram of (**a**) an image with a citrus leaf infected by the fungus _A. citri_ (_Alternaria_) or (**b**) of the citrus leaf only. Gray histogram of (**c**) an image with a citrus leaf infected by the fungus _Diaporthe citri_ of melanose or (**d**) of the same citrus leaf only. Three triplets of color histograms are required for the extraction of the rest of the features used in the employed classification method.