# Maize Seed Embryo and Position Inspection Based on Image Processing

Yingbiao Wang, Liming Xu, Xueguan Zhao, Xingjie Hou

► To cite this version:

Yingbiao Wang, Liming Xu, Xueguan Zhao, Xingjie Hou. Maize Seed Embryo and Position Inspection Based on Image Processing. 7th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2013, Beijing, China. pp.1-9, 10.1007/978-3-642-54341-8_1.hal-01220662

HAL Id: hal-01220662

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

Submitted on 26 Oct 2015

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
# Maize Seed Embryo and Position Inspection Based on Image Processing

Yingbiao Wang<sup>1,a</sup>, Liming Xu<sup>b*</sup>, Xueguan Zhao<sup>c</sup>, Xingjie Hou<sup>d</sup>

Key laboratory of Soil-Machine-Plant System Technology, China Agricultural University,
Beijing, China, 100083

<sup>a</sup>wybjob@163.com, <sup>b</sup>xlmoffice@126.com, <sup>c</sup>zhaoxueguan.com@163.com,

<sup>d</sup>hou19890809@126.com

**Abstract.** Orientational planting cannot only make maize leaf growing consistently, but also improve the leaf photosynthetic capacity of unit area and yield of maize. The "tip" direction was detected and the angle of deflection was measured by using contour curvature analysis method of maize seed, the S component of HSV channel was preprocessed by Otsu method, the automatic extracting maize seeds embryo and orientation information have been realized through image color channel conversion, segmentation, preprocessing, and its contour characteristic analysis. A rectangular region ROI in the image was defined and counts up pixels within the region, the region-specific positive and negative ROI pixels were compared by T<sub>M</sub> threshold and the embryo side towards was identified. This paper adopted Zheng-958, Jundan-20 and Zhongke-11 maize seed for research object, each variety was repeated three times by using the above methods. The results showed that the average accuracy of embryo inspection was more than 95%; the direction average angle was 2.2 °.

**Keywords:** Image processing, Maize seed, Orientational planting, Position inspection, Embryo

## 1 Introduction

Maize is an important crop in the world. The orientational planting cannot only make maize leaf growing consistently, but also improve the maize leaf photosynthetic capacity of unit area and yield of maize. Thereby, enhancing unit area of maize leaf photosynthesis is able to increase yield [1-2]; there are many researchers to try to put maize seeds manually to be fixed and achieve orientational sowing, but the seeding efficiency is too low to suit for large-scale operations. In order to improve the orientational seeding efficiency and effect, it has to find a way for the seed orientation and fixed in the soil to adopt the combination of mechanization and automation, so the key technology is to achieve orientation of maize seeds. Because of its unique and irregular appearance characteristics of maize seed, it is more difficult to achieve

<footnote>*Corresponding author</footnote>
orientation of maize seeds. Therefore, the image processing technology can be used to identify the embryo of the maize seed.

The image processing technology has been widely used in agricultural products inspection and grading, such as cereal grain color, grain shape and type of identification, fruit shape and defects [3-9] and other exterior quality inspection, but the application of maize seed orientation for mechanized seeding research rarely reported. In this paper, the embryo and position of maize were obtained by the image processing technology to provide technical support for subsequent mechanized orientational planting.

## 2 Image Processing and Inspection Methods

According to the situation of the maize sowing into the soil, there are 13 kinds of position and orientation relative to the row direction [10], but only four kinds of that are easy to implement mechanized planting, which are perpendicular or parallel to the row for embryo up and down (Fig.1). To determine the position and direction of maize seeds, each seed has a fixed orientation and position. This paper adopted Zheng-958, Jundan-20 and Zhongke-11 maize seed for research object, the direction radicle of the maize seed deflection angle was taken for the positioning standard in long axis direction, the embryo surface and obverse were distinguished through the embryo color image processing, this paper mainly located the maize seed classify feature and color feature detection.

<figure><img src="image_2.png" /><figcaption>(a) Embryo up and down, perpendicular to the row (b) Embryo up and down, parallel to the row</figcaption></figure>

<caption>**Fig.1** Maize seed position and direction</caption>

### 2.1 Image Preprocessing

The greyscale image is divided into two kinds of A and B type based on Otsu segmentation method, the probability of occurrence and mean gray level of A and B type can be calculated, after that the inter-class variance can be calculated also, so the maximum variance was chosen as the best threshold. The background gradient of RGB are removed based on Otsu method, the noise was suppressed by using image smoothing operators, the result of applying a 3×3 median filter to the image and converting from RGB mode to HSV in Fig.2(b), the gray level distribution range was transform to [0-255] [11], and the H, S, V three single channel were extracted from
HSV channel in Fig.2(b), otherwise, it were preprocessed with binarization processing and the morphological noise reduce processing.

<figure><img src="image_3.png" /><figcaption>Fig.2 Image color channel analysis of maize seed</figcaption></figure>

## 2.2 The direction inspection method for maize seed

Most crop seeds have end "tip" in the direction of the long axis, and the other end is relatively flat, for example: garlic, pumpkin, and sunflower. For such seed direction discrimination method, the image edge of garlic clove pointed position corner was found using SUSAN detection algorithm, and to identify garlic seed direction [12]. The same method has been used in Reference [13] and Reference [14], the seed orientation is judged by scanning seed edge on fixed area and comparing both directions of the seed edge pixels number within the region. This method has the advantages of high success rate of identification easy to control, and can distinguish the general orientation, but it can't accurately quantify the deflection angle of the seed direction.

This paper adopted the best aspects of several algorithms, the seed head was distinguished by the area scanning method, the maize seeds and deflection angle were analyzed and distinguished with the contour curvature. The edge of preprocessed image was detected by using Candy operator, the maximum outer contours of the edges image of maize seed to be found and saved in {$S_i$}, the contour point of maximum curvature was found by the {$S_i, S_{i-1}$} and {$S_i, S_{i+1}$} of the inner product of two vectors, this point is the expectation, k is the precision of calculations, the definite steps is shown in Fig.3. Because the maximum curvature was on the terminal of contours, the minimal result of inner product is satisfactory. The maximum curvature point of the contour through round-robin comparison was turned into point of maize cusp. The straight line that connected to the maximum curvature point $P_1$ and corn contour centroid point $P_0$, that was regarded as the axis of the corn, the angle $\theta$ between the axis and the vertical line was calculated as a reference in a vertical direction, it is shown by formula (1), the direction will be determined by judging the size of $\theta$, the inner product of vectors is shown in Fig.4 and the detection result is shown in Fig.5.

$$ \theta = \cos^{-1} \frac{\overline{S_i S_{i+1}} \overline{S_i S_{i-1}}}{\overline{|S_i S_{i+1}|} \overline{|S_i S_{i-1}|}} \quad (1) $$
<figure><img src="image_4.png" /><figcaption>Fig.3 Flow chart of Seeds direction detection algorithm</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Fig.4 Inner product of vectors</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Fig.5 Detection result</figcaption></figure>

## 2.3 The embryo inspection method for maize seed

As shown in Fig.6, the mass center of maize seeds for the grey value was obviously on the high side after binarization in the S channel for embryo up, but it has no obvious change for the embryo down, due to the influence that the surface has no embryo. The collected images were transformed from RGB to HSV channel, and its S channel was extracted to conduct gradation processing [15]. Binarization processing was done according to the threshold determined by Otsu method. A rectangular ROI region was defined, which central was the maize contour centroid, the length of the half major axis was regarded as the long side of the rectangle, the length of the half minor axis was regarded as the short side, so the ROI region was scanned progressively and calculated the number of the pixels which gray value was 255, The
result P was tested according to the preset threshold T<sub>M</sub>, the calculating process was shown in Fig.7; P is calculated by formula (2):

$$P = \begin{cases} 1 & T = (\sum_{i=i_0}^{i=i_k} \sum_{j=j_0}^{j=j_k} M(i, j) = 255) / S > T_M \\ 0 & T = (\sum_{i=i_0}^{i=i_k} \sum_{j=j_0}^{j=j_k} M(i, j) = 255) / S \le T_M \end{cases} \quad (2)$$

M (i, j) is the grey value of point (i, j), T is the rectangular area ratio of black pixels inside the rectangular area, S is the area of the rectangle, the point (i<sub>0</sub>,j<sub>0</sub>) and the point (i<sub>k</sub>,j<sub>k</sub>) are the diagonal point of the rectangle.

<figure><img src="image_7.png" /><figcaption>Fig.7 Embryo detection algorithm</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>(a) Embryo up</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>(b) Embryo down</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>(a) Embryo up</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>(b) Embryo down</figcaption></figure>

<caption>Fig.8 The results of embryo inspection</caption>

If the P = 1, the maize embryo is upward; else P = 0, maize embryo is downward. Each 100 seeds of three varieties were selected: Zheng-dan958, Jun-dan20 and Zhong-ke11 for the experiment test. The T value will be to calculate according to the above method under the maize embryo was upward and downward, and the distribution of T value was obtained as shown in Fig.9. The T value was more than 0.45 when maize embryo was upward, while the T value is less than 0.15 in commonly for downward, The T is 0.4 to be the threshold of T<sub>M</sub> and judge the orientations of embryo surface.

<figure><img src="image_12.png" /><figcaption>Fig.9 T<sub>M</sub> scatter diagram</figcaption></figure>
# 3 Experiments and Result Analysis

The position and orientation of maize seed are determined, which needed to the full surface contours and color information. The image has been taken by automatic Exmore R CMOS digital camera (SONY, DSC-WX7 type), the lens maximum aperture range is from F2.6 to F6.3, The image resolution is 640×480pix, and the format of image is JPEG, it was output via USB2.0 interface.

## 3.1 Experiments of direction inspection

In this experiment, each 100 seeds of the Zheng-dan958, Jun-dan20 and Zhongke11 maize varieties were chosen and divided into two kinds of directions. Among them, the radicle tips of 50 seeds were pointed to the top of the picture, the radicle tips of other 50 seeds were pointed to bottom of picture. The number of seed with radicle point to the top of picture is decided to qualified index. The result of inspection was achieved by image processing. At the same time, the deflection angle value was calculated and recorded. The test was repeated for three times, the results are shown in table 1. The accuracy for the direction inspection of three different variety seed was above 98%, the minimum average value of the deflection angle was 1.8 degree.

<table><caption>**Table 1.** The result of direction inspection</caption><thead><tr><th>Factor</th><th>Time/Result</th><th>Upward</th><th>Downward</th><th>Maximum (degree)</th><th>Minimum (degree)</th><th>Average (degree)</th></tr></thead><tbody><tr><td rowspan="2">Manual</td><td>1 time</td><td>50</td><td>50</td><td>0</td><td>0</td><td>0</td></tr><tr><td>2 time</td><td>49</td><td>50</td><td>3.4</td><td>2.2</td><td>2.7</td></tr><tr><td rowspan="3">Zheng-dan958</td><td>3 time</td><td>50</td><td>49</td><td>3.5</td><td>1.8</td><td>2.2</td></tr><tr><td>Accurate rate</td><td>99%</td><td>99%</td><td></td><td></td><td></td></tr><tr><td>1 time</td><td>50</td><td>50</td><td>3.8</td><td>2.1</td><td>2.8</td></tr><tr><td rowspan="3">Jun-dan20</td><td>2 time</td><td>50</td><td>50</td><td>3.7</td><td>2.4</td><td>2.6</td></tr><tr><td>3 time</td><td>49</td><td>50</td><td>3.5</td><td>1.9</td><td>2.4</td></tr><tr><td>Accurate rate</td><td>99%</td><td>100%</td><td></td><td></td><td></td></tr><tr><td rowspan="3">Zhong-ke11</td><td>1 time</td><td>49</td><td>49</td><td>3.3</td><td>1.7</td><td>2.3</td></tr><tr><td>2 time</td><td>50</td><td>50</td><td>3.4</td><td>2.2</td><td>2.8</td></tr><tr><td>3 time</td><td>49</td><td>50</td><td>3.6</td><td>2.4</td><td>2.9</td></tr><tr><td></td><td>Accurate rate</td><td>98%</td><td>99%</td><td></td><td></td><td></td></tr></tbody></table>

## 3.2 Experiments of embryo orientation inspection

In the same way, each 100 seeds of the Zheng-dan958, Jun-dan20 and Zhongke11 maize varieties were chosen and divided into two kinds of embryo up and down, each test were chosen 50 seeds. It was tested same with the above method, the results were shown in table 2, the accurate rate of Zheng-dan958 for embryo up was 98%, the Jun-dan20 was 93%, the Zhong-ke11 was 93%. In addition, the accurate rates for embryo down respectively were 99%, 98% and 95% respectively.
<table><caption>**Table 2.** The result of embryo orientation inspection</caption><thead><tr><th>Factor</th><th>Time/Result</th><th>Embryo up</th><th>Embryo down</th></tr></thead><tbody><tr><td rowspan="2">Manual</td><td></td><td>50</td><td>50</td></tr><tr><td>1 time</td><td>47</td><td>49</td></tr><tr><td rowspan="3">Zheng-dan958</td><td>2 time</td><td>45</td><td>50</td></tr><tr><td>3 time</td><td>50</td><td>50</td></tr><tr><td>Accurate rate</td><td>94%</td><td>99%</td></tr><tr><td rowspan="6">Jundan20</td><td>T average value</td><td>0.68</td><td>0.12</td></tr><tr><td>1 time</td><td>48</td><td>50</td></tr><tr><td>2 time</td><td>49</td><td>48</td></tr><tr><td>3 time</td><td>50</td><td>50</td></tr><tr><td>Accurate rate</td><td>98%</td><td>98%</td></tr><tr><td>T average value</td><td>0.59</td><td>0.13</td></tr><tr><td rowspan="4">Zhong-ke11</td><td>1 time</td><td>45</td><td>50</td></tr><tr><td>2 time</td><td>46</td><td>47</td></tr><tr><td>3 time</td><td>49</td><td>46</td></tr><tr><td>Accurate rate</td><td>93%</td><td>95%</td></tr><tr><td></td><td>T average value</td><td>45</td><td>50</td></tr></tbody></table>

## 4 Conclusions

Maize is the second large crop in China. The orientational planting cannot make maize leaf growing consistently, but also improve the maize leaf photosynthetic capacity of per unit area and yield of maize. So the extraction of maize embryo and orientation method based on image processing has been conducted in this paper. The automatic extracting maize seeds embryo and orientation information has been realized through image color channel conversion, segmentation, preprocessing, and its contour characteristic analysis. Through three maize varieties experiments, the conclusions are shown in follows:

A contour curvature analysis method was put forward to determine the maize seed "tip" direction, the maize seed "tip" direction was detected and the angle of deflection was measured using contour curvature analysis method.

The S channel of HSV image was preprocessed by Otsu method, a rectangular region ROI in the picture was defined and the pixels within the region had been calculated, the region-specific ROI pixels of the positive and negative maize seed were compared by $T_M$ threshold, so the maize seed embryo side towards had been distinguished.

This paper adopted Zheng-958, Jundan-20 and Zhongke-11 maize seed for research object, each variety was repeated three times by using the above methods, the results showed that the average accuracy of embryo inspection was more than 95%; the direction average angle was 2.2°.
Acknowledgment

The fund for this research was provided by Specialized Research Fund for the
Doctoral Program of Higher Education (20120008110045) and the Fundamental
Research Funds for the Central Universities (2012YJ105).

References

1. Pandey A K, Khatoon S. Effect of orientation of seed placement and depth of sowing on seedling emergence in Sterculia urens Roxb [J]. Indian Forester.1999, 125(7):720-724.

2. Hou Yanlong, Xu Liming, Chen Liming. The Current Situation and Development Trend of Corn Mechanization Oriented Seeding Technology [J]. Journal of Agricultural Mechanization Research.2012, (2):10-14(in Chinese)

3. Yarnia M, Tabrizi EFM. Effect of Seed Priming with Different Concentration of GA3IAA and Kinetin on Azarshahr Onion Germination and Seedling Growth [J]. J.Basic.Appl.Sci. Res.2012, 2(3): 2657-2661.

4. Sun Ming, Wang Yiming, Ling Yun, et al. A hue based detecting approach to yellow rice kernel [J]. Transactions of the Chinese Society for Agricultural Machinery, 2005, 36(8): 78-81(in Chinese)

5. Liao K, Marvin R, Paulsen M R, et al. Rea-l time detection of color and surface defects of maize kernels using machine vision[J]. Journal of Agricultural Engineering Research, 1994, 59(4):263-271

6. Cheng Hong, Shi Zhixing, Yao Wei, et al. Corn breed recognition based on support vector machine[J]. Transactions of the Chinese Society for Agricultural Machinery, 2009, 40(3):180-183(in Chinese)

7. Yang Shuqin, Ning Jifeng, He Dong jian. Identification of corn breeds by BP neural network [J]. Journal of Northwest Sc-I Tech University of Agriculture and Forestry, 2004, 32(Supp): 189-192(in Chinese)

8. Ying Yibin, Cheng Fang, Ma Junfu. Rea-l time size inspection of citrus with minimum enclosing rectangle method [J]. Journal of Biomathematics, 2004, 19(3):352-356(in Chinese)

9. YingYibin, JingHansong, Ma Junfu, et al. Application of machine vision to detecting size and surface defect of Huanghua pear [J]. Transactions of the Chinese Society of Agricultural Engineering, 1999, 15(1):197-200(in Chinese)

10. ChenYing, LiaoTao, Lin Chukao, et al. Grape inspection and grading system based on computer vision [J]. Transactions of the Chinese Society for Agricultural Machinery, 2010, 41(3): 169-172(in Chinese)

11. Jiang Guanghua, Han Yingzhi, Wang Yanhong, et al. Directional and Precision Sowing Techniques of Corn [J]. Agricultural Engineering, 2012, 2(2):17-20(in Chinese)

12. Lei Xu, Randomized Hough transforms (RHT): Basic mechanisms, algorithms, and computational complexities [J]. CVGIP: Image Understanding, 1993(57):131-154

13. Ning Jifeng, He Dongjian, Yang Shuqin. Identification of tip cap and germ surface of corn kernel using computer vision [J]. Transactions of the CSAE, 2004, 20(3):117-119(in Chinese)

14. Yang Qingming, Li Juanling, He Ruiyin. Direction identification of garlic seeds based on image processing [J]. Acta Agriculturae Zhejiangensis, 2010, 22 (1): 119-123(in Chinese)

15. Wang Huihui, Sun Yonghai, Zhang Tingting, et al. Appearance Quality Grading for Fresh Corn Ear Using Computer Vision [J]. Transactions of the Chinese Society for Agricultural Machinery.2011, 41(8): 156-158(in Chinese)