## 2 Materials and Methods
### Image Processing Method and Feature Extraction
These are the RGB histograms of the spots, the normal plant part and the halo around the spots. Figure 5a-c shows these histograms for the citrus leaf of Figure 3a. The halo histogram displayed in Figure 5c has been derived by a zone of 3 pixels wide (a configurable parameter) around each spot. Since there is no halo around the spots, it consists in this case mainly of normal leaf pixels or spot pixels that failed to be identified. The shape of these histograms is not the same in different diseases. It may also be slightly different for photographs showing different leaves, infected by the same disease, if they are captured under different light exposure or at different stages of the disease progression. Some basic rules can be followed to avoid extreme environmental condition variations like using photographs that have been taken under a canopy to avoid intense shades, selecting cloudy rather than sunny days to take the photographs, etc. In order to moderate the symptom diversity caused by the variety of these conditions, several signatures are defined in the developed application corresponding to different progression levels of a disease. For example, grapevine downy mildew caused by the agent _Plasmopara viticola_ appears initially as a brighter lesion than the normal grape leaves that turns to brown spots in later stages. Two disease signatures can be defined for these two stages of the same disease. Figure 4: Spot separation for a fruit infected by the dematiaceous hyphomycete of _Pseudocrcospora_. Original image (**a**), SSM1 with \(T_{h}=30\), \(B_{g}=130\) (**b**), SSM1 with \(T_{h}=20\), \(B_{g}=130\) (**c**), SSM1 with \(T_{h}=40\), \(B_{g}=130\) (**d**), SSM2 (**e**), SSM3 (**f**). Figure 3: Spot separation for a leaf (upper surface) infected by the fungus _Diaporthe citric_ of melanose. Original image (**a**), spot separation method (SSM)1 with \(T_{h}=20\), \(B_{g}=130\) (**b**), SSM1 with \(T_{h}=10\), \(B_{g}=130\) (**c**), SSM1 with \(T_{h}=30\), \(B_{g}=130\) (**d**), SSM2 (**e**), SSM3 (**f**). Moreover, a color normalization technique has been employed to moderate the light exposure variations. The gray level of the normal plant part is used as a reference to adjust the brightness of the lesion and the spots. More specifically, the average gray level \(\widetilde{G_{N}}\) of the normal plant part is estimated by the training photographs during the signature definition. When a new photograph is examined, the new gray level \(G_{N}\) of the normal plant part is also estimated and the signed difference \(D_{N}=\widetilde{G_{N}}-G_{N}\), is added to all the color planes (R, G, B) of the lesion and the halo pixels before the analysis takes place. Figure 5: Red-green-blue (RGB) color histograms for the leaf (**a**), the spot (**b**) and the halo (**c**) of Figure 3a image. Feature comparison between melanose and _Alternaria_ spots: red (**d**), green (**e**) and blue (**f**) color. This color normalization technique has been initially tested in the skin disorder diagnosis application presented in [27], that is based on the same image segmentation and classification method. Gray images are often normalized through linear DRE, using the following formula:  
\[g_{new}=\frac{g_{old}-g_{min}}{g_{max}-g_{min}}255, \tag{3}\]  
where \(g_{new}\), \(g_{old}\) are the new and the old gray level of a specific pixel and \(g_{min}\), \(g_{max}\) are the minimum and maximum gray level in the region of interest. However, if this color stretching is applied independently to the basic colors of an RGB image, it will be distorted. Despite this distortion, we have attempted to apply a similar type of normalization as the one described by Equation (3) to the value component of hue-saturation-value (HSV), or the lightness component of hue-saturation-lightness (HSL) or International Commission on Illumination (CIE) L*a*b color space. The results of the DRE normalization in these color spaces are presented in Section 3.