# Detection Technology for Precision Metering Performance of Magnetic-Type Seeder Based on Machine Vision

Deyong Yang, Jianping Hu, Zuqing Xie

► To cite this version:

Deyong Yang, Jianping Hu, Zuqing Xie. Detection Technology for Precision Metering Performance of Magnetic-Type Seeder Based on Machine Vision. 4th Conference on Computer and Computing Technologies in Agriculture (CCTA), Oct 2010, Nanchang, China. pp.555-562, 10.1007/978-3-642-18333-1_66. hal-01559576

HAL Id: hal-01559576

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

Submitted on 10 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_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Detection Technology for Precision Metering
Performance of Magnetic-type Seeder Based on Machine
Vision

Deyong Yang¹,², Jianping Hu², Zuqing Xie²

¹ School of Mechanical Engineering, Jiangsu University, Zhenjiang, Jiangsu Province, P. R. China 212013

² Key Laboratory of Modern Agricultural Equipment and Technology, Ministry of Education & Jiangsu Province, Jiangsu University, Zhenjiang, Jiangsu Province, P. R. China 212013
yangdy@163.com

**Abstract.** Magnetic-type seeder is a precision metering device, particularly suitable for small seeds. A visual inspection system for precision performance of magnetic-type seeder was established based on machine vision and image processing technology. By using pre-treatment techniques including image binarization and image filtering, image quality was enhanced effectively. As the gray-scale value of the seeds coated with magnetic powder is very close to the electromagnet, the method of seed feature extraction based on morphological image processing is proposed and performance testing model of precision metering seed is put forward. The results of comparison between machine vision and manual detection showed that the relative error of preciseness was less than 3% and coefficient of variation and standard deviation were less than 5%, which indicated the system is of high accuracy when used in real-time detection.

**Keywords:** precision metering, performance detection, magnetic-type seeder, machine vision

# 1. Introduction

Metering device is the core component of seed planters, which performance is important for planter design and manufacture. The performance improvement of precision metering device depends on accurate and efficient detection technology. There were manual detection, opto-electronic scanning [1], piezoelectric pulse and high-speed photography [2] and other methods. In the recent years, the research of non-contact detection of precision planting quality using machine vision technology conducted gradually [3],[4],[5],[8]. Magnet roller-type precision seeder was developed according to magnetic seed-metering principle, which solve precision seeding of small seed like vegetable seeds and flower seeds [6].In this research, vision detecting of precision performance of magnetic-type seed metering device was undertaken, and visual detection accuracy was discussed.
## 2. Materials and methods

### 2.1. Seed

Rape seed of 2.412 g/1000 seeds was used for this study. Seeds must be coated with magnetic powder.

### 2.2. The vision detection system

A test stand with camera system was used to detect performance of precision metering device, as shown in Fig.1 and Fig.2. Magnetic-type seed metering device has 4 rows magnetic head per revolution. Sufficient oil was added to the top surface of the seed-bed belt to capture the seed as it was released from metering device. The speeds of the metering roller were set at 15, 20 and 30 rpm while the speed of seed-bed belt was 0.5 m/s.

The camera is a high-resolution, black-and-white, low-light, manual gain adjustment MTV-1881EX equipped with AVENIR Seiko CCTV lens, manual iris of F1.3, focal length of 8mm. Lighting system is made up of the lighting box, 12V DC lamps and blocking mask, and 6 lamps are fixed below the box, and the camera and lighting are arranged hierarchically to obtain stable, no shadow and uniform illumination image to meet the needs of image processing.

<figure><img src="image_2.png" /><figcaption>1 screen filter and fuel tank 2 driving roller 3 seed-bed motor 4 seed-bed belt 5 camera system 6 metering motor 7 magnetic-type seeder 8 fuel injection device 9 driven roller</figcaption></figure>

<figure><img src="image_3.png" /><figcaption>Fig. 2. Photograph of precision seeder test-bed</figcaption></figure>

As seed-bed belt moved at a constant speed, seeds from the metering device fall onto the moving belt and were stuck on the belt. With the movement of the belt,
seeds go through the camera and the camera records images and collect data, then transfer into the computer for processing.

## 2.3. image processing

Because the images in the collection and transmission process were interfered by all sorts of disturbance and contain random noise in addition to images useful signal, the images must be treated by a series of methods, such as median filtering and image splicing, to remove the noise and make seed target and background separate completely.

### 2.3.1. Binary image processing

In seed image acquisition process, relatively stable reservoir thickness, viscosity, seeds, colour and lustre etc are likely to make gray-scale values of image pixel except seeds are 1. Therefore, seeds are separated with background by using binary processing.

The background in this research is simple and few changed, so a preprocessing fixed threshold method was tried, namely, by setting a certain threshold, make gray scale image into two gray value of black-and-white images, which would target and background separated. Its function expression is as follows:

$$f(x) = \begin{cases} 0 & x < T \\ 1 & x \ge T \end{cases} \qquad (1)$$

Where $f(x)$ is the image matrix, x the gray value and T the selected threshold value of binary image processing.

Threshold value was set 90 in this research after repeated tests and the image after binary processing is shown in Fig.3.

<figure><img src="image_4.png" /><figcaption>Fig. 3. image of Binary processing</figcaption></figure>

### 2.3.2. Image filtering

Sequence of images contain useful signals and also contains a variety of random noise because of internal and external interference. In order to reduce the noise and improve image quality, it is necessary to smooth image after binary treatment.

Image smoothing processing adopt 3 x 3 neighborhood median filtering method that is, the value of a point in the digital image is the median value of values of all points in a field instead.
If {$x_{ij}, (i, j) \in I^2$} is gray value of digital images, two-dimensional median filter with filtering template A can be defined as:

$$y_{ij} = Med_{A}\{x_{ij}\} = Med\{x_{i+r, j+s}, (r, s) \in A, (i, j) \in I^2\} \quad (2)$$

The image after filtering is shown in Fig. 4.

<figure><img src="image_5.png" /><figcaption>Fig. 4. image of filtering</figcaption></figure>

## 2.4.Seed feature extraction

### 2.4.1.Marking region

After image processing region of seed is separated with background. However, the gray values of all regions of seeds are 1. It is necessary to mark regions of seeds for determining the seed properties, such as seed number, size and location coordinates.

Labeling algorithm combining with sequential scanning and parallel dissemination is used for regional mark, as shown in Fig. 5. The image is scanned by TV raster, and 1-pixel with no label is detected. The unused label is assigned to it, and 1-pixels located in 8-neighborhood of it are given the same label. The label begins to spread from first 1-pixel one by one until no 1-pixel in 8-neighborhood of labeled pixel exists and the operation ends. All connected 1-pixel have the same label. The image is scanned again, and if unlabeled 1-pixel is found, the same treatment is conducted. Otherwise, the processing is completed.

<figure><img src="image_6.png" /><figcaption>Fig. 5. Mark regions of seeds</figcaption></figure>

### 2.4.2.Seed number feature extraction

While marking regions of seeds, the pixel that is not belong to seed area is marked to 0, the pixel that is belong to the same seed area is given the same label which is not equal to zero. The label of pixel is different from regions of the seeds. Therefore, the number of seed is obtained by calculating number of these nonzero label.
### 2.4.3 Seed position feature extraction

After the region of seeds was marked, pixels with the same label are regarded as a seed. As long as the centroid of seed region was obtained, it is regarded as the center of the seed [7].

If a binary image {$f(x, y); x, y = 0,1,...,N-1$} is given, the pq-order image moment is defined as follows [5]:

$$M_{pq} = \sum_{p} \sum_{q} f(x, y)x^p y^q \quad p, q = 0,1,2... \quad (3)$$

Different values of p, q can obtain different moments $M_{pq}$. As the performance was concerned with center of mass, the center coordinates of the seed is defined as follows:

$$\bar{(x, y)} = (\frac{M_{10}}{M_{00}}, \frac{M_{01}}{M_{00}}) \quad (4)$$

Coordinate with the top-left corner of a image, for the X axis is to the right direction, for the Y axis is downward, as shown in Fig. 6. As seed spacing was measured along longitudinal coordinate, $\bar{y}$ difference between two adjacent seed was just seed spacing.

<figure><img src="image_7.png" /><figcaption>Fig. 6. Coordinate system of image</figcaption></figure>

Through testing the seeds and coordinates the seed spacing between adjacent seeds, and analysis of metering device of qualified rate, leakage, replay broadcast rate main performance indexes.

## 3. Results and discussion

According to the relevant test standards, single seed precision sowing experiment was done continuously measured 250 seed spacing as a statistical sample. The speeds of the metering roller were set at 15, 20 and 30 rpm respectively while the speed of seed-bed belt was 0.5 m/s.
## 3.1 metering precision detection

Main indexes of precision performance of magnetic-type metering device are preciseness, multiple index and miss index. Detection of precision metering were done by using machine vision and manual methods respectively, comparative analysis for different metering roller speed is listed in Table 1-3.

<table><caption>**Table 1.** Precision results at metering roller speed of 15 rpm</caption><thead><tr><th></th><th>Preciseness (%)</th><th>Multiple index (%)</th><th>Miss index (%)</th></tr></thead><tbody><tr><td>Manual method</td><td>84.28</td><td>15.72</td><td>0</td></tr><tr><td>Machine vision</td><td>83.33</td><td>16.67</td><td>0</td></tr><tr><td>Relative error</td><td>0.94</td><td>5.69</td><td>0</td></tr></tbody></table>

<table><caption>**Table 2.** Precision results at metering roller speed of 20 rpm</caption><thead><tr><th></th><th>Preciseness (%)</th><th>Multiple index (%)</th><th>Miss index (%)</th></tr></thead><tbody><tr><td>Manual method</td><td>31.13</td><td>39.63</td><td>29.24</td></tr><tr><td>Machine vision</td><td>30.77</td><td>38.46</td><td>30.77</td></tr><tr><td>Relative error</td><td>1.17</td><td>3.04</td><td>4.97</td></tr></tbody></table>

<table><caption>**Table 3.** Precision results at metering roller speed of 30 rpm</caption><thead><tr><th></th><th>Preciseness (%)</th><th>Multiple index (%)</th><th>Miss index (%)</th></tr></thead><tbody><tr><td>Manual method</td><td>26.99</td><td>48.51</td><td>25.50</td></tr><tr><td>Machine vision</td><td>26.32</td><td>47.37</td><td>26.31</td></tr><tr><td>Relative error</td><td>2.54</td><td>2.41</td><td>3.08</td></tr></tbody></table>

Table 1,2,3 show preciseness decreases and multiple index increases with metering roller speed increasing. Relative error of preciseness between machine vision detection and artificial detection is less than 3%, relative error of multiple index less than 6%, relative error of miss index less than 5%. The results show that testing accuracy of precision metering by machine vision is required.

## 3.2 Sowing uniformity detection

Sowing uniformity factors include mean seed spacing, standard deviation and coefficient of variation of seed spacing. Detection of precision metering were done by using machine vision and manual methods respectively, comparative analysis for different metering roller speed is listed in Table 4-6.
<table><caption>**Table 4.** Sowing uniformity results at metering roller speed of 15 r/min</caption><thead><tr><th></th><th>Mean seed spacing (m)</th><th>standard deviation (%)</th><th>Coefficient of variation (%)</th></tr></thead><tbody><tr><td>Manual method</td><td>1.175</td><td>0.23</td><td>19.58</td></tr><tr><td>Machine vision</td><td>1.200</td><td>0.24</td><td>20.00</td></tr><tr><td>Relative error</td><td>2.13</td><td>4.17</td><td>4.2</td></tr></tbody></table>

<table><caption>**Table 5.** Sowing uniformity results at metering roller speed of 20 r/min</caption><thead><tr><th></th><th>Mean seed spacing (m)</th><th>standard deviation (%)</th><th>Coefficient of variation (%)</th></tr></thead><tbody><tr><td>Manual method</td><td>0.771</td><td>0.18</td><td>23.61</td></tr><tr><td>Machine vision</td><td>0.793</td><td>0.19</td><td>23.96</td></tr><tr><td>Relative error</td><td>2.85</td><td>4.21</td><td>1.46</td></tr></tbody></table>

<table><caption>**Table 6.** Sowing uniformity results at metering roller speed of 30 r/min</caption><thead><tr><th></th><th>Mean seed spacing (m)</th><th>standard deviation (%)</th><th>Coefficient of variation (%)</th></tr></thead><tbody><tr><td>Manual method</td><td>0.483</td><td>0.187</td><td>38.69</td></tr><tr><td>Machine vision</td><td>0.498</td><td>0.192</td><td>38.57</td></tr><tr><td>Relative error</td><td>3.11</td><td>2.6</td><td>3.11</td></tr></tbody></table>

Table 4,5,6 show coefficient of variation of seed spacing increases with increased metering roller speed. Relative error of standard deviation between machine vision detection and artificial detection is less than 5%, relative error of coefficient of variation less than 5%. The results show that testing accuracy of precision metering by machine vision is required.

The main reasons of differences between the manual measurement and system measurement based machine vision were error of manual measurement and error of image processing because location of center of mass of seeds changed and tiny seeds were neglected.

## 4. Conclusions

This paper constructed the performance detection system of precision magnetic-type metering device. After a series of image processing, such as image binary, image filtering, the region of seeds are separated with background. By regional marking, seed properties are easily determined. Such number of seeds was obtained efficiently and center of mass coordinates were achieved by using moment characteristics, which provided a satisfactory basis of the performance detection.
The parameter data of precision performance from vision detection system and
manual detection are not significantly different. Therefore ,vision detection system
can be used instead of manual detection.

**Acknowledgments.** This work was financially supported by the open fund of Jiangsu Provincial Key Laboratory of Modern Agricultural Equipment and Technology, Jiangsu University (NZ200604), by Eleventh Five-Year-Plan National Scientific & Technological Supporting Project(2006BAD11A10).

References

1. Y. Lan, M. F. Kocher, J. A. Smith, Opto-electronics Sensor System for Laboratory Measurement of Planter Seed Spacing with Small Seeds, Agric.Eng.Res, vol. 72, pp. 119--227 (1999)

2. Liao Qingxi, Deng Zaijing, Huang Haidong, Application of the High Speed Photography Checking the Precision Metering Performances, Journal of Huazhong Agricultural University, no.5, pp. 570--573 (2004)

3. Wang Yushun, Guo Junwang, Zhao Xiaoxia, et al. Performance detection and analysis of a machine vision based metering mechanism of drill. Transactions of the Chinese Society of Agricultural Machinery, vol. 36, no 11, pp. 50--54 (2005)

4. Hu Shaoxing, Detecting Technology of the Properties of Seed Metering Based on Computer Vision, PhD diss, Jilin University, Changchun (2001)

5. Cai Xiaohua, Wu Zequan, Liu Junjie Xie, et al. Graindistance real-time checking and measuring system based oncomputer vision. Transactions of The Chinese Society ofAgricultural Machinery, vol. 36, no 8, pp. 41--44 (2005)

6. Hu Jianping, Mao Hanping. Analytical and experimental study on principle of precision seed2meter by magnetic force .Transaetions of the Chinese Society for Agricultural Machinery, vol. 35, no 4, pp. 55--58 (2004)

7. Cvibovic. M, Kune. M, An approach to the design of distributed real-time systems, Micro-processors and Microsystems, vol. 20, pp. 241--250 (1996)

8. Cai Xiaohua, Wu Zequan, Liu Junjie, Grain Distance Real-time Checking and Measuring System Based on Computer Vision, Transactions of the Chinese society for Agricultural Machinery, vol. 36, no. 8, pp. 41--44 (2005)

9. SiWei Technology, Visual C++/MATLAB Image processing and recognition of practical cases selected, Posts & telecom press, BeiJing (2004)

10.Chen Chuanbo, Digital Image Processing, China Machine Press, Beijing (2004)