# A Review of Plant Disease Detection Systems for Farming Applications
## 2 Literature Review: Precision Agriculture Research Developments
### Plant Disease/Pest/Weed Detection System Basic Principles
#### 2.1.1 Image Processing
& \multirow{4}{*}{[[http://www.cs.waikato.ac.nz/mL/weka/](http://www.cs.waikato.ac.nz/mL/weka/)]([http://www.cs.waikato.ac.nz/mL/weka/](http://www.cs.waikato.ac.nz/mL/weka/)) (accessed on 13 February 2023)} \\  & & increase and nonlinear programming, kernel-based & \multirow{4}{*}{[[http://image.diku.dk/](http://image.diku.dk/)]([http://image.diku.dk/](http://image.diku.dk/)) shark/ (accessed on 14 February 2023)} \\  & & learning algorithms, and other methods for & \multirow{4}{*}{(accessed on 18 February 2023)} \\  & & machine learning [49]. & \\ \hline \multirow{8}{*}{mplex} & \multirow{4}{*}{Provides the data-processing techniques as simplified control scripts, Python bindings, and C++ objects that can be used in more extensive & \multirow{4}{*}{(accessed on 18 February 2023)} \\  & & machine learning solutions [50]. & \\ \hline \multirow{8}{*}{LLi6 VM} & \multirow{4}{*}{A support vector machines (SVM) library [51].} & http: \\  & &  
A very popular example of an image segmentation technique is thresholding [55]. Threshold segmentation is a process of converting a color or grayscale image into a binary image (as shown in Figure 8) with the sole purpose of making feature classification easier [55; 56]. The output binary images consist of black and white colored pixels that correspond to the background and foreground, respectively, or vice versa [26; 55; 56]. Threshold segmentation is mathematically defined as follows, where \(T\) refers to a certain threshold intensity, \(g\) is the black or white pixel of a binary image, and \(f\) is the gray level of the input picture [56]:  
\[g(x,y)=\left\{ \begin{array}{ll}0,&if\ f(x,y)<T\\ 1\ if\ f(x,y)>T\end{array} \right. \tag{1}\]  
Threshold segmentation is subdivided into global, local, and adaptive thresholding [15; 57]. Global thresholding is applied in scenarios where there is enough distribution between the intensity distribution of the foreground compared to the background [15]. Hence, a single threshold value is selected and used to distinguish between the features of significance and the background [15; 55]. Local thresholding is applied in cases where there is no distinct difference in intensity distribution between the background and the foreground and hence it is not conducive to selecting a single threshold value [55]. In such a case, an image is partitioned into smaller images, and different threshold values for each partitioned picture are selected [15]. Adaptive thresholding is also appropriate for images with uneven intensity distribution because a threshold value is calculated for each pixel [57]. The Otsu thresholding method is another thresholding technique used for image segmentation [15]. In this technique, a measure of spread for the pixel intensity levels on either side of the threshold is listed by looping through all the reasonable threshold values [58]. The intent is to decide the threshold value for which the summation of foreground and background escalates is at its minimum [15; 58]. The fundamental characteristic of the Otsu thresholding method is the fact that it implements the threshold values automatically instead of it being preselected by the user [58]; (2) below shows the mathematical definition for the thresholding in the Otsu method. \[g(x,y)=\left\{ \begin{array}{ll}1,&f(x,y)>T\\ 0,&0\ otherwise\end{array} \right. \tag{2}\]  
Another segmentation method applied in image processing is watershed transformation [59]. A grayscale image undergoes a transition called a watershed [59; 60]. In a metaphorical sense, the name alludes to a geologic catchment or drainage split that divides parallel catchments [59]. The watershed conversion locates the lines that follow the tops of ridges by treating the image it operates upon as a topographic map; the luminosity of each pixel denotes its elevation [60]. Figure 9 is an example of a watershed-segmented image in which  
Figure 8: Example of thresholding image segmentation [26].