<figure><img src="image_1.png" /></figure>

HAL
open science

# Grading Method of Crop Disease Based on Image Processing

Youwen Tian, Lide Wang, Qiuying Zhou

► To cite this version:

Youwen Tian, Lide Wang, Qiuying Zhou. Grading Method of Crop Disease Based on Image Processing. 5th Computer and Computing Technologies in Agriculture (CCTA), Oct 2011, Beijing, China. pp.427-433, 10.1007/978-3-642-27278-3_45. hal-01361010

HAL Id: hal-01361010

https://inria.hal.science/hal-01361010

Submitted on 6 Sep 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Grading Method of Crop Disease Based on Image Processing

Youwen Tian, Lide Wang, Qiuying Zhou

College of Information and Electric Engineering, Shenyang Agricultural
University, China
youwen_tian10@163.com

**Abstract.** At present, in the crop disease harm degree is graded mainly by measure with the eye or paper cut primarily, which is greatly influenced by subjective factors, and results in obvious error. For improvement on identification precision of crop disease, this paper developed a new crop disease grading method based on computer image processing. Image preprocessing, segmentation and statistical calculation were applied effectively in this study. According to crop disease harm degree and classification standard, the crop disease harm degree was determined by computing the proportion of sickness spot area and the normal area on the leaf. The experiment results indicated that the identification accuracy was greatly improved, the grading time and costs is reduced by the manual evaluation, providing accurate data for the study of the crop's other aspects and has a broad prospect for application.

**Keywords:** Computer image processing; crop disease grading; grading system

## 1 Introduction

Crop often subjected to various adverse environmental biotic and abiotic factors in growth and development process, leading to crop disease, resulting in a massive decline in crop production. Thus agricultural producers must obtain the crop disease hazard information quickly and accurately, adopt targeted prevention method, scientific and systematic management of disease in field, in the most economic way to restore the losses caused by diseases. But the current commonly used measurement method of crop disease harm degree is visual method or paper card classification method. Because this method is influenced by subjective factors grading error is relatively large, especially for small and many lesions of disease leaves time-consuming and great error were gotten to grade. Thus this no longer adapts to the development of modern agriculture needs. Therefore development of a rapid and accurate measurement methods of crop leaf disease grading is of great practical significance.

The computer image processing technique has many virtues such as high processing precision, good repeatability, strong quantitative and adaptability, capable of handling a large volume of data etc, so it is widely used in many fields, especially in agricultural engineering field, which shows unparalleled advantage.
According to the features of crop leaf spots when infected, the study adopted advanced digital image processing technology to make accurate judgment rapidly on the damage degree of crop disease, thus the agricultural producers can save loss caused by the crop disease at the most economical cost, can meet the demand of agricultural producers, reduce pesticide on agricultural products and environment pollution.

# 2 Materials and Method

## 2.1 Materials

The main purpose of this study is to make disease harm degree to grade on the crops leaves infected. In this study the most extensive crop diseases, namely in crops, fruit trees and vegetables are easily infected, and harm degree is the most serious symptoms on leaves, the most obvious manifestation of the disease is as study object. In the Cucumber Greenhouse, Field Corn and Fruit Grape research base of Shenyang Agricultural University, several disease leaves of downy mildew, powdery mildew and scab in cucumber, big spot, leaf blight, gray leaf spot in corn and downy mildew, powdery mildew, anthracnose in grape were collected on the field.

## 2.2 Testing Device

According to the requirements of research, the image acquisition system was constructed, as shown in Fig.1. The light box of the system is a homemade light box, which size is 80cm×80cm×80cm, inner 5 ring lamps act as the light source. The image sensor is used Panasonic WV-CP234 color CCD camera made in Japan Mataushita Electric Industrial Company or SONY DSC-F717 color CCD digital camera AverMedia, which made in SONY of Japan. PCI standard image acquisition card with the display module ensure the image real-time display in high quality, and with a communication interface. P4 compatible computer was applied in the system of computer image processing, with the frequency of 2GHz, memory of 1G, and hard disk of 80G.

## 2.3 Methods

Computer image processing technology was applied in this experiment. The crop disease severity degree was graded in fundamental steps as follows: image preprocessing, image segmentation and statistical calculation. First of all, acquire the images of the crop disease leaves. Subsequently, the color image vector median filtering method is applied to preprocess the crop leaf disease image. Then on the pretreated crop disease image selection of suitable color space based on lesion and normal color difference, segment the lesion and normal part using statistical pattern recognition method; then calculate the ratio percentage of the lesion area and the leaf area. According to crop disease harm degree and classification standard, the crop
disease harm degree were determined. Finally, the crop disease intelligent damage degree grading of hardware system and software system is developed for crop disease intelligent hazards degree grading system.

<figure><img src="image_3.png" /><figcaption>1-Light box; 2- light source; 3- video camera or a digital camera; 4- Acquisition card
5- host machine; 6- monitor</figcaption></figure>

<caption>Fig.1 Computer image acquisition system</caption>

# 3 Results and Analysis

## 3.1 Disease Image Preprocess

For color disease image, traditional image enhancement methods cannot properly remove noise and keep the edge. Therefore, this research make full use of color information of crop diseases image, the R, G, B value of each pixel in the image as a feature vector, applying a improved vector median filtering method enhanced crop disease image.

The improved vector median filtering method is to take the average of all vector $\bar{X}$ in the window to obtain mean vector $\bar{X}$, calculating the distance from the vector $\bar{X}$ to the mean vector $\bar{X}$, the vector whose distance is the nearest from the vector $\bar{X}$ as the element output value in window center. Therefore the algorithm is as follows:

(1) Calculating the mean vector in window, and calculating the distances from each vector to the mean vector $\bar{X}$:

$$ \bar{r} = \sum_{i=1}^{s} r_{i} / s \qquad \bar{g} = \sum_{i=1}^{s} g_{i} / s \qquad \bar{b} = \sum_{i=1}^{s} b_{i} / s \qquad (1) $$

$$ S'_{i} = \| x_{i} - \bar{x} \| \qquad (2) $$

(2) After comparing all values of $s'_{i}$, the smallest value of them is selected as $s_{min}$.
(3) The pixel $X_{min}$, which corresponding to $S_{min}$' is the vector median in the window, replacing the pixel vectors in window center.

If the minimum value of $S_{min}$ in not unique according to the above algorithm, how to determine the mean vector is not given in this method. In this research, the $X_i$ is treated as median vector, which is corresponding to $S_{min}$.

With the improvement of color image vector median filtering method as above stated, the cucumbers, grapes, corn disease leaf images were enhanced. Experimental results show that the improved algorithm has the advantages of better edge and details and does not increase new colors. In addition it has a small amount of calculation, its running time is short, it is simple and easy to realize. So the improved vector median filtering method was applied in this study.

## 3.2 Image Segmentation

Crop disease image has complex components, the leaf spots arranged on no rules, and a different color depth. Since diseases are different, the spot color is not the same. It can be seen from the image of crop leaf disease, the leaf infected is composed of two parts: lesion and normal portion, essentially it is a two class of problems. Therefore this research applied the statistical pattern recognition classification approach to segmentation image.

Suppose discriminant function is linear, the general expression is:

$$g(x) = w^T x + w_0 \quad (3)$$

Where $x$ is a three-dimensional feature vector, $w$ is called the weight vector. They are respectively expressed as follow:

$$x = [R, G, B]^T, \quad w = [w_1, w_2, w_3]^T \quad (4)$$

Where $w_0$ is a constant, known as the threshold.

The classifier was designed according to the following steps:

(1) Take representative disease spot part and normal part of training data set.

(2) In the three dimensional RGB color space, to each type of sample of statistical analysis, calculating each type of data sets m1, m2, s1, s2, and concluded that $w^*$.

(3) According to $y = w^T x$, draw a one-dimensional data set, and carries on the statistical analysis to determine the classification threshold $y$.

(4) Scanning image, according to $y = w^T x$, determine the image of each pixel point of projection $y$.

(5) According to the decision rules, making decision classification.

$$y \ge y_0 \rightarrow \begin{cases} x \in L_1 \\ x \in L_2 \end{cases}$$

Applying above classifier, the disease leaf images of cucumber, corn and grape were isolated from background respectively. The test results as shown in Fig.2. As can be seen from the graph, good segmentation results were obtained, and spot part can be divided from the normal part basically.
<figure><img src="image_4.png" /></figure>

After crop disease image segmentation, there are often isolated points, burr and small cavities in the image. In order to reduce the noise effect on the subsequent identification, open and close operation in mathematical morphology was applied in this study to eliminate noise, so as to achieve the ideal image.

### 3.3 Grading Method of Crop Disease Based on Image Processing

The crop disease harm degree classification level are expressed as the percentage of disease spot area to total leaf. Because the lesion area is proportional to the number of the pixel in the lesion region, the normal leaf area is proportional to the number of the pixel in the normal region, so the leaf damage degree classification grades can be expressed as the ratio k of the number of the pixel in the lesion region to that in the normal region.

$$k = \frac{A_1}{A} = \frac{N_1}{N} \qquad (5)$$

Where A represents the disease leaf's total area, A₁ represents lesion area, N represents the pixel number in the leaf, N₁ represents the pixel number in lesion area.

Based on crop disease original image preprocessing and image segmentation, this study completed damage degree automatic grading by effective extraction of the crop disease leaf area and the disease spot area. Therefore, according to the ratio k of the number of the pixel in the lesion region to that in the normal region in pros and cons of diseased leaf segmented, disease severity can be identified and the leaf infected level can be obtained. According to documents standard and modification protocol of plant protection experts, crop disease is divided into 6 levels, the specific grading standards as shown in Table 1.

This study respectively applied image processing technology, the leaf area meter and paper cut method to determine the cucumber disease damage degree and classification.

The crop disease harm degree values determined by leaf area meter method were treated as the standard values of disease harm degree. The experimental results showed that the harm degree of crop diseases, either by the image processing system measurement or by paper cut measurement are compared with the standard value, there is an error of certain degree. The accuracy of the system by image processing measurement is higher than that of paper cut measurement. So crop disease damage degree automatic grading system is more effective based on the image processing.
<table><caption>Table 1. Crop disease classification standard</caption><thead><tr><th>level</th><th>0</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th></tr></thead><tbody><tr><td>cucumbers</td><td>0%</td><td>0.1%~5%</td><td>5.1%~10%</td><td>10.1%~25%</td><td>25.1%~50%</td><td>50.1%以上</td></tr><tr><td>corn</td><td>0%</td><td>0.1%~5%</td><td>5.1~10%</td><td>10.1%~30%</td><td>30.1%~70%</td><td>70.1%以上</td></tr><tr><td>grape</td><td>0%</td><td>0.1%~5%</td><td>5.1~30%</td><td>30.1%~50%</td><td>50.1%</td><td></td></tr></tbody></table>

## 3.4 System Realization

In this study the crop disease automatic recognition system is developed in the WINDOWS environment with MATLAB 7.01. Software system mainly includes the system interface, image preprocessing, image segmentation and harm degree of crop disease classification module.

Finally, according to the harm degree of plant disease and classification results, disease grade was shown, especially for cucumbers, grapes and corn disease harm degree of determination, specific for disease automatic grading of cucumber downy mildew, powdery mildew and scab, grape downy mildew, powdery mildew and anthracnose and corn big spot, leaf blight and grey spot disease. The results interface of the crop disease harm degree is shown in Fig.3.

<figure><img src="image_5.png" /><figcaption>Fig.3 Results of disease harm degree</figcaption></figure>

## 4 Conclusion

The grading accuracy was greatly improved by using image processing technology on crop leaf disease level classification, reducing the time and costs by the manual evaluation, providing accurate data for the study of the crop's other aspects. The hardware requirement of computer by this method is very low. The crop disease grading method can be implemented effectively; It can make up of defects and deficiencies by artificial classification, improving the classification grading and efficiency. This technology has broad prospects for application.
References

1. Mao Hanping, Xu Guili: Identification the deficit of tomato nutrient elements based on computer vision. Transactions of the Chinese Society for Agriculture Machinery, vol.34, pp 73~75(2003)

2. Tian Youwen, Li Tianlai, Li Chenghua, et al. Method for recognition of grape disease based on support vector machine. Transactions of the CSAE, vol.23, pp175~179 (2007)

3. Camargo A, Smith J S. Image pattern classification for the identification of disease causing agents in plants. Computers and Electronics in Agriculture, vol.66, pp 121~125(2009)

4. Cen Zhexin, Li Baoju, Shi Yanxia, et al. Discrimination of cucumber anthracnose and cucumber brown speck based on color image statistical characteristics. Acta Horticulturae Sinica, vol.34, pp 1425~1430(2007)

5. Zhang Zheng, Wang Yanping, Xue Guixiang. Digital Image Processing and Machine Vision—Visual C++ and Matlab. BeiJing. People's posts and Telecommunications Press, (2010)