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

HAL
open science

# Target Recognition for the Automatically Targeting Variable Rate Sprayer

Maogang Li, Yan Shi, Xingxing Wang, Haibo Yuan

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

## To cite this version:

Maogang Li, Yan Shi, Xingxing Wang, Haibo Yuan. Target Recognition for the Automatically Targeting Variable Rate Sprayer. 4th Conference on Computer and Computing Technologies in Agriculture (CCTA), Oct 2010, Nanchang, China. pp.20-28, 10.1007/978-3-642-18354-6_4. hal-01563462

HAL Id: hal-01563462

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

Submitted on 17 Jul 2017

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_3.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Target recognition for the automatically targeting Variable Rate sprayer

Maogang Li¹, Yan Shi ²*, Xingxing Wang³

1 College of Mechanical & Electrical Engineering, Qingdao Agricultural University, Qingdao 266109, China;

2 College of food Science and Engineering, Qingdao Agricultural University, Qingdao 266109, China;

3 College of food Science and Engineering, Qingdao Agricultural University, Qingdao 266109, China;

* Corresponding author, Address: Foodstuff Science and Engineering college, Qingdao Agricultural University, 700 Changcheng Road, Qingdao, 266109, P. R. China, Tel:0532-88030446, Email: shiyan517@163.com

**Abstract.** In order to quickly and accurately realize target recognition when the crop demanding, adopt green strength of RGB's method to identify the crop from the background of elaphic, the recognition accuracy was more than 98%. Use density DBSCAN fuzzy clustering algorithm, by means of setting two parameters ε and MinN, in the density DBSCAN fuzzy clustering algorithm, to determine a cluster gather on the each target, by means of judging the existence of the clustering gather or not to determine the target. With the help of image division technology, calculate the area ratio of the target and calculate the need of quantity of spraying. By means of calculating the centre point of each clustering gather(target), realize to control sprayer motion trail, realize accurately targeting and variable rate spraying pesticide (Fertilizer) when the crop sowing in line at seeding.

**Keywords:** fuzzy clustering algorithm, image division technology, target recognition

## 1 Introduction

For a long time, as the low level of pesticide use (the effective utilization rate is only about 30%), Not only wasted the massive agricultural chemicals, but also has caused the serious pollution to the ecological environment. In order to solve the environment pressure which the agricultural chemicals spray massively cause, study automatic spraying device on the target

through the imagery processing technology development. Precision spraying has become an important tendency in modern agriculture development[1-3]. Automatic spraying system can achieve the target precision pesticide spraying and the purpose of saving. Target recognition is the key technology.

In the 1990s, developed countries had carried out a study of the precise spraying and the target recognition. University of California, Davis institute, D. C. Slaughter, R. D. Lamm and D. K. Giles developed cotton weeding machine robot based on the cultivation platform in 2002[4], University of Kansas, NINGWANG designed a real-time embedded wheat weed identification and spraying on the target system in 2002[5], Gerhards designed the precise spraying system based on map information[6], R. Tangwongkit, V. M. Salokhe development variable spraying embedded system between the sugarcane lines and based on machine vision[7]. China Agricultural University study of automatic target pesticide system[8], Orchard Automatic Target electrostatic sprayer[9], automatic spraying system that automatically spraying disease plant [10], Nanjing Forestry University of trees study of a system based on machine vision image acquisition and real-time identification system[11].

To achieve accuracy of the target pesticide, first of all, to solve the target object to identify and determine the amount of pesticide spraying,
Use density DBSCAN fuzzy clustering algorithm, by means of setting two parameters ε and MinN, in the density DBSCAN fuzzy clustering algorithm, to determine a cluster gather on the each target, by means of judging the existence of the clustering gather or not to determine the target. Calculated green plant the number of pixels in the image and its corresponding area ratio though Image Segmentation. The system can accurately identify targets, at the same time meet the requirements of real-time processing.

## 2 Identification of crop and soil background

In the experimental field of Qingdao Agricultural University with SONYDSC-S730 digital camera, in different light (sunny / cloudy), different land conditions, Screen corn's color image captures. Digital cameras capture the image is JPEG format, to easily deal with, programming using Microsoft Visual C++6.0, the 24-bitJPEG format images were converted to 24 - bitBMP format images, taking BMP image as original image to deal with. Each image in each pixel has R, G, B three components constitute, which was affected by the light under natural condition, each image's pixel R, G and B will change.

The 2G-R-B's value as the color segmentation factor is that in this division factor in the increased weight of green crops, highlighting the characteristics of green crops, and thus can make better segmentation and background of green crops. Green plants of the G-B and G-R to the value slightly higher than the value of non-green plants, which is the first comparison of the RGB, then calculate the division factor, Formula as follows:

$$f(i, j)=255 \quad \text{when } R>G \text{ or } B>G$$

$$f(i, j)=2G-R-B \quad \text{else}$$

<figure><img src="image_4.png" /><figcaption>Fig. 1. Green strength of RGB's method to identify the crop from the background of elaphic (a)(c)original image from field (b)(d)the image with Green RGB feature algorithm</figcaption></figure>

## 3 Determining the clustering on each Plant crops

In this study, fuzzy clustering algorithm based on DBSCAN thought, the algorithm core ideas: that a class for each object in its neighborhood of a given radius of the object that contains not less than a given number. The basic

idea is that, $\forall x_i, x_j \in X$, if $x_j \in N_\epsilon(x_i)$ and $|N_\epsilon(x_i)| \ge \text{MinN}$, $x_j$ direct density up to $x_i$, where $N_\epsilon(x_i) = \{x_i | x_i \in X, D(x_i, x_j) \le \epsilon\}$ is a

close neighbor to become the core of the object. The algorithm is in the desktop (CPU: P41. 6 G, RAM: 256 M, hard disk capacity: 40 GB) use object-oriented language of Microsoft Visual C++6.0 to program.

DBSCAN clustering algorithm, the algorithm steps:
Step1 Input $ε > 0$, MinN>0;

Step2 Calculate X, the number of neighbors for each point $ε$, find all of the core object X;

Step3 Automatically select any one of the core that does not belong to any cluster object $ε$ neighbors to create a new cluster;

Step4 Circulating collection of the clustering of the core object until $ε$ neighbor to join the cluster by adding a new core object;

Step5 If there is no clustering of the core of any object, end algorithm Otherwise jump back step3;

Step6 All images are scanned, the processing end.

<figure><img src="image_5.png" /><figcaption>**Fig. 2.** Use density DBSCAN fuzzy clustering algorithm to determine a cluster gather on the each target.</figcaption></figure>

(a)(d) field collection of original image (b)(e) I grayscale (c)(f)image that used the fuzzy clustering algorithm.

First image (a) and (d) for conversion, RGB model is transformed into a HIS model, generated I component of the gray image (b) and (e). I grayscale was application by DBSCAN clustering algorithm, which can find pixels that density was more concentrated, with this method, we can, in the image, find the green plants of each strain to one or several cluster set (also the same pixel density is set). The results shown in Figure (c) and (f). Using API function timeGetTime() of MicrosoftVisualC++6.0 get the algorithm time consuming, time accurate to ms, DBSCAN clustering algorithm runs in before the call timeGetTime() to get a time value dwStart, and then in the end of DBSCAN clustering algorithm called timeGetTime() be another time value dwEnd, then time consuming of the algorithm is dwEnd-dwStart. The fuzzy clustering algorithm consumes time 31ms-33ms in this method.

## 4 Determining the centre point of each clustering gather(target) and the sprayer motion trail

Regional marker is attached to the connection with the same pixel tags, links to content on different regions with different tags attached.

the algorithm as follow:

Step1 Scanned images, encountered not the goal marking pixels, to add a new tag (lable).

Step2 The target pixel to pixel connected to add the same tag.

Step3 The pixel connected to Marking pixels add the same tag.

Step4 Connected pixels until all is added tags. Thus, a connection component was added the
same tag.

Step5 Back Step1, re-add the tag and find new unmarking pixels, Repeat the steps above.

Figure 3 is processed by the regional labeling algorithm, the results as follow:

<figure><img src="image_6.png" /><figcaption>Fig. 3. Regional markers algorithm</figcaption></figure>

(a)(b) Not improved region labeling algorithm to generate image

(c)(d) Improved region labeling algorithm to generate image

By improving region labeling algorithm can make the green with a collection of different clustering using the same tag, and then struck the center of green plants per plant, in turn connect the center produce a track (composed of white pixels Line), this track is the lower level machine nozzle trajectory, The results shown in Figure 4-a and 4-b as follows:

<figure><img src="image_7.png" /><figcaption>Fig. 4. Sprayer motion trail
(a)(b) the image of sprayer motion trail</figcaption></figure>

## 5 Computing crop area ratio of pixels

The pixel size was defined the total number of pixels, Therefore, crop area ratio of pixels was pixel area of crops and the ratio of total pixel

$$ \rho_{ratio of pixel area of crops} = \frac{S_{crop}}{S_{the total pixel area}} $$
area, then
1-a, the pixel is 300 × 480, that the number of pixels is 300 × 480 = 144 000,
$S_{the total pixel area} = 144000$, $S_{crop}$ need to be calculated
through the procedure, first fig 1-a map was carried through identifying crops from soil, and statisticing the number of green pixels. In figure

1-a $S_{crop}=6085$, $S_{ratio of pixel area of crop}=0.04225$. When calculating pixel area of each crop, each crop was divided into the original image to 1/3, and then to calculate $S_{crop}$, as shown below:
<figure><img src="image_8.png" /><figcaption>Fig. 5. Image Segmentation
(a)(b)(c) Figure trisection</figcaption></figure>

Pixel number and area ratio as shown in Table 1:
Table 1 the number of pixels per plant and the
area ratio of crop

<table><thead><tr><th></th><th>the number of pixels</th><th>area ratio</th></tr></thead><tbody><tr><td>S<sub>1crop</sub></td><td>2417</td><td>2417/144000</td></tr><tr><td>S<sub>2crop</sub></td><td>2066</td><td>2066/144000</td></tr><tr><td>S<sub>3crop</sub></td><td>1062</td><td>1062/144000</td></tr><tr><td>S<sub>the total pixel area</sub></td><td>144000</td><td>144000/144000</td></tr></tbody></table>

Drawn from Table 1 that each plant crops the
number of pixels in the image and its
corresponding area ratio.

## 6 Conclusion

1) Adopt green strength of RGB's method to identify the crop from the background of elaphic, the recognition accuracy was more than 98%. Handle a 300 × 480 pixel image, time-consuming 15ms.

2) Use density DBSCAN fuzzy clustering algorithm, by means of setting two parameters ε

and MinN, in the density DBSCAN fuzzy clustering algorithm, to determine a cluster gather on the each target, by means of judging the existence of the clustering gather or not to determine the target. With the help of image division technology, calculate the area ratio of the target and calculate the need of quantity of spraying. By means of calculating the centre point of each clustering gather(target), realize to control sprayer motion trail, realize accurately targeting and variable rate spraying pesticide ( Fertilizer ) when the crop sowing in line at seeding. Handle a 300 × 480 pixel image, time-consuming 31ms-33ms.

3) Through image segmentation, the image is divided into, each division contains only one green, and then calculate the number of green pixels and the total number of pixels the image ratio, calculated area ratio. According to the value of area ratio, calculated the value of the corresponding application rate, controlled lower machine to achieve the precise purpose of spraying.

## References

1.Schuster I, Nordmeyer H, Rath T. Comparison of vision2based and manual weed mapping in sugar beet[J]. Biosystems Engineering, 2007, 98 (1) : 17225.

2.Mansheng Long; Dongjian He. Weed identification from corn seedling based on computer vision [J]. Transactions of the Chinese Society of Agricultural Engineering. 2007, 23 (7) : 1392144.

3.Hanping Mao, Bo Hu. Parameter optimization of herbicide spraying in weed identification with machine vision [J]. Chinese Journal of Scientific Instrument. 2008, 4(4).

4.Slaughter D. C., Lamm. R. D, Giles. D. K, Precision weed control system for cotton [J]. Transactions of ASAE, VOI45(1): 231-138, 2002.

5.Wang, N. Q. Stoll, D. E. Peterson. A. Real-time embedded Weed detection system for using in
wheat fields[J]. Biosystems Engineering, 2007, 98:276-285

6.Gerhards. R, Sokefeld M. Site-specific weed control in maize, sugar beet, winter wheat and winter barley[J]. precision Agriculture. 2002, 3, 25-35.

7.Tangwongkit R., Salokhe V. M. Development of Real-time, Variable Rate Herbicide Applicator Using Machine Vision for Between-row Weeding of Sugarcane Fields [J]. precision Agriculture. 2006, 8, 1-12.

8.Yan Shi. Study on the System of Spraying Rate Varied by Pressyre of Liquid Chemical Application [D]. Bei Jing: China Agricultural University, 2004.

9.Xiongkui He, Kerong Yan. Design and testing of the automatic target detecting, electrostatic, air assisted, orchard sprayer [J]. Transactions of The Chinese Society of Agricultural Engineering, 2003, 19 (6) : 78 ~ 80.

10.Ronghua Ji, Lijun Qi, Zetian Fu. Automatic spraying system of target recognition of plant disease (J). Transactions of the Chinese Society for Agricultural Machinery, 2007, 6.

11.Yong Chen, Jia qiang Deng. Control system for precision pesticide application based on variable rate technology [J]. Transactions of The Chinese Society of Agricultural Engineering, 2005, 21 (5) : 69 ~ 72.