Microsoft Word - cet-01.docx CHEMICAL ENGINEERING TRANSACTIONS VOL. 46, 2015 A publication of The Italian Association of Chemical Engineering Online at www.aidic.it/cet Guest Editors: Peiyu Ren, Yancang Li, Huiping Song Copyright © 2015, AIDIC Servizi S.r.l., ISBN 978-88-95608-37-2; ISSN 2283-9216 Research on The Precision Seeding System for Tiny Particle Seed Based on Machine Vision Shuixuan Chen, Liang Jiao, Huxiu Xu, Jianmin Xu* School of mechanical and automotive engineering, Xiamen University of Technology, Xiamen, China, 361024 xujianmin1020@163.com A detection algorithm with machine vision that can quickly identify the number of seed particles is proposed by comparing the standard image templates with capture images. The online identification sorting system for small particles of seeds is designed based on machine electrical integration technology. The precise concern area is set up for the acquired image using image mask function. The image noise interference is reduced through the methods that include the image look-up table function, gray value erosion and dilation processing of morphology. The geometric features template previously divided that is carrot Seed image is searched to determine whether such a template is existed. The shape detection and image parameters output for particle image are conducted to determine the number of seed particles by using particle analysis function. High-speed solenoid valve is controlled by PLC (Programmable Logic Controller) to select seeds exactly and the package is carried out using seeds weaving technology. The seed single hole rate can be reached more than 92%. 1. Introduction Precision sowing device is designed for precision seeding tiny particles. From the 1940s to now, a number of countries with high degree of agriculture automation for precision seeding equipment have reached a high level of mechanical and electrical integration through long-term development (Rommelse et al. (2004)). Artificial seeding for the seeds with tiny particles is the main way in china, So the cost of the method is high and it has low efficiency, and the seed waste is very serious (Lin et al.(2010)), (W ang et al.(2005)). A sorting equipment with online identification is designed for seeds with tiny particles based on machine vision technology. Seeds image is collected in order to locate and analyze. Image pre-processing, geometric matching and gray-scale morphological analysis are carried out in platform LabVIEW 2011so as to determine the number of seed particles. High-speed solenoid valve for precision seed selection is controlled by using PLC. The proposed method in the paper can solve the problem of replay seed rate and high hole rate, at the same time it can reduce waste seed and planting costs. 2. The design of overall system mechanism Machine vision, machine electrical integration technology, vacuum chuck mechanism, visual acquisition module, image processing algorithms and real-time control actuators will be analyzed and studied combining with machine vision and machine electrical integration technology. The precise identification control system is shown in figure 1. PCIe bus NI PCIe1443 Visual acquisition card Solenoid valve Miniature cylinder Camera link CMOS camera Lighting source control I/O output PLC Figure 1: Precise identification control system DOI: 10.3303/CET1546172 Please cite this article as: Chen S.X., Jiao L., Xu H.X., Xu J.M., 2015, Research on the precision seeding system for tiny particle seed based on machine vision, Chemical Engineering Transactions, 46, 1027-1032 DOI:10.3303/CET1546172 1027 Images are collected by using camera CMOS which are transmitted to the PC (personal computer). It is processed by the vision module and the results are sent to the PLC. Then the seeds are selected by solenoid valve that is controlled by PLC. The precision sowing mechanism is divided into five modules according to the function that the institution should realize. It includes a support module, a vision module, a power module, a suction module and a take seed module. The three-dimensional map of vacuum suction mechanism is shown in figure 2. The suction module with the speed of uniform rotation is driven by the power module. The seeds are adsorbed on the suction module by atmospheric pressure . At the same time the image acquisition for seeds is conducted by machine vision module. Image is transmitted to IPC (Industrial Personal Computer) by image acquisition board. Then it is processed and the results are sent to the PLC. Seeds selection is conducted by take seed module, which is controlled by PLC. The system ca n achieve high efficiency of precision seed selection (W ang and W ei (2008)). Figure 2: The three-dimensional map of vacuum suction mechanism 3. Analysis and research on vision algorithms Image analysis algorithm of this system mainly includes image acquisition, image processing and image analysis identification. 3.1 Image acquisition source The ring LED astigmatism is used as a light source in order to make the light evenly distributed around the collection object. The effectiveness of image acquisition is ideal, which is shown in Figure 3. Figure 3 lists the lighting effects of several experiments. Under the condition of uniform illumination, the effect of the picture is the best. It can help the subsequent processing. Figure 3(a): Light intensity Figure 3(b): The shortage of light Figure 3(c): The non-uniform illumination Figure 3(d): Uniform illumination 3.2 Functions and algorithms of image pre-processing In practice, the sucker's own imperfections and dirt adhesion can become the image noise. Whe n the various noise reaches a certain amount, the processing tasks of subsequent image will not be carried out. Therefore, smoothing processing must be carried out before the image processing and analysis. The system uses a median filter for image smoothing. Median filter algorithm is as follows. There is a one-dimensional sequence  , which is filtered by the window with the length of m ( m is an odd number). They have been extracted from the input sequence number 1 1, , nf f f (Wang et al.(2012)) 1 1 1 , , , , , , i v i i i n f f f f f     (1) Then the value of the point m is arranged according to their numerical size. Take the number in the middle of that value as the output filter. The mathematical formula can be expressed as follows. 1028  , , , ,i v i i vYi Med f f f i Z   (2) (3) The above method will be applied to the image filtering, it must be converted to two -dimensional filtering formula. (4) Where and ( , )g x y are the original image and the target image. W is a two-dimensional template. Usually a square domain is selected, and other shapes may also be cross-shaped, linear, circular etc. 3.3 The matching functions and algorithm of geometric template Image processing is performed in the pixel coordinate system. The number of rows and columns of image  ,i j is corresponding to integer coordinates of the image grid. Image plane coordinates are defined as follows (Blayvas et al.(2006)).The main point of the camera, which is assumed to be the intersection of the optical axis and the image plane, is located in the center of the image. If the image array is m n , the center coordinates of the image plane coordinates are as follows. 1 2 x m c   (5) 1 2 y n c   (6) Where ( , ) x y c c represents the estimated value of the center coordinates. The x -axis direction in image plane coordinates is the column direction of increasing the number of labels. However y axis direction is the direction of reducing the number of lines label. Assumed that the row spacing of image array was equal, the conversion formula from pixel coordinates  ,i j to image coordinates ( , )x y   is as follows. 1 2 m x j     (7) 1 2 n y i          (8) If the row spacing of image array is not equal, column spacing is set to xs , the line spacing is set to ys , and the conversion formula from the pixel coordinates to the image coordinate is as follows. 1 2 x m x s j         (9) 1 2 y n y s i          (10) There are position and orientation differences between templates objectives and image to be recognized because of real-time image acquisition, so the matching is carried out after normalization (Giachetti and Asuni (2011)). The size of the whole map ( , )f x y M N  is set to, which is shown in figure 4. If the geometric characteristics of the template is ( , )x y with the size of J K , then there are J M and . The related quantity 0 ( , )R m n is used to represent the correlation between them, which is expressed as follows. 0 ( , ) ( , ) ( , ) x y R m n f x y x m y n   (11) The normalized correlation amount 0 ( , )R m n between ( , )f x y and ( , )x y is obtained , which is defined as follows. 1 2 m v   ( , ) { ( , ), ( , ) }g x y Med f x k y l k l W    ( , )f x y K N 1029 1 1 2 2 1 1 1 1 ( , ) ( , ) ( , ) ( , ) ( , ) J K J K J K J K J K J K f j k j m k n R m n f j k j m k n                  (12) Figure 4: Global sample correlation at point 3.4 Analysis functions and algorithms of image morphology In morphological processing, the gray-value-corrosion treatment for the image is conducted in order to separate bright objects and dark objects. This can make it easier to find the noise. On the basis, inflation is conducted to expand the outlook so as to enlarge images in bright. At the same time, Shrink background can reduce interference of image analysis. 3.4.1 Morphological gray-scale corrosion Let ( )f x and ( )g x are the two functions defined on D Rn and G Rn .The symmetric function of ( )g x respect to the origin is ( ) ( )gs x g x  . Where ( )f x is the input function, ( )g x is a structural function. The corrosion of structure function ( )g x respect to ( )f x is defined as follows.  ( ) max{ : }f g x y gx y f    (13) In the process of morphological operation gradation, the structural element ( , )g i j is the template. The minimum of gray-scale difference is searched in the image. From the perspective of signal processing, differential operation of gray-scale morphological is an extreme value filtering technology. Therefore gray morphology is a non-linear and irreversible transformation. 3.4.2 Gray-scale morphological expansion Let ( )f x and are the two functions defined on and .The symmetric function of ( )g x respect to the origin is .Where is the input function, is a structural function (Yeh and Perng(2005)). The expansion of structure function respect to is defined as follows. ( )( ) min{ : }f g x y gsx y f    (14) In the process of gray-scale morphological expansion, the structural element is the template. The maximum of gray-scale difference is searched in the image. 4 Experimental analysis 4.1 Image pre-processing (mask) test In the process of image acquisition, CMOS cameras will be subject to interference from a variety of environmental noise, so that the image quality decreases. In order to facilitate subsequent image processing and analysis, the image needs to be pre-processed. Image pre-processing of the system are mainly image mask and image smoothing processing. Contrast of image mask effect is shown in figure 5 (a) and figure 5 (b). Results of original image after treatment of mask function are shown in figure 5 (b). (a) (b) Figure 5: Contrast of image mask effect y N x M (m,n) w(x,y) J K ),( nm ( )g x D Rn G Rn ( ) ( )gs x g x  ( )f x ( )g x ( )g x ( )f x ( , )g i j 1030 4.2 Experiments of look-up table image analysis Image analysis was performed using a look-up table Square algorithm. The area containing important information can be highlighted and other areas will be ignored(Mery and Carrasco(2005)). It significantly improves image contrast and brightness, making it easier for binary image processing . The results are shown in figure 6. Figure 6 (a) shows the original image. After the process of look-up table function, the image area which contains important information is prominent. (a) (b) Figure 6: Contrast of effect before and after pre-treatment 4.3 Matching experiments of geometric template The match of geometric template needs to establish particles template firstly, which is shown in figure 7. Then recognition learning is conducted in the test images. After the end of the study, it will mark the learning objects and scores sizes of template matching. determine the minimum match score and the number of hits. Finally, the matching result can be obtained, which is shown in Figure 8. Wherein the match score is distributed from 0 to 1000, and 1000 is identical. Matching scores of similarity between object to be measured and the template are 1000, 803.55, 795.72. And the data is shown in Table 1. Figure 7: Particle template Figure 8: Matching results of geometric template Table 1 Results coordinate and match scores of geometric matching Result 1 2 3 X Position 149.47 135.50 655.50 Y Position 126.46 175.50 73.50 Angle 0.01 111.00 300.00 Scale 100.13 100.00 100.00 Score 1000.00 803.55 795.72 4.4 Morphology experiments Seeds image after pre-treatment needs to be morphological processed. The isolated point is excluded from the background by using corrosion function in the basic morphology and the target profile is etched based on structural elements. Etching operation will make target smaller. The function for removing small objective of the advanced morphological is used to clear small goals. Small target is determined by the number of corrosion. Tiny holes are excluded from the background by expanding the target. And expanding the target contour is to patch notched edges of the image based on structural elements. Figure 9 shows the comparison before and after morphological analysis (a) (b) Figure 9: Comparison before and after morphological analysis 4.5 Experiment of particle analysis Image parameters include area of Interest, binarization threshold settings, particle Size limit, the upper limit of the particle area, particle / grayscale algorithm. Interest region is used to determine a position to be detected. Binary particle analysis is used to determine which value is the desired characteristic. The upper 1031 limit and lower limit of the particle area is used to determine a detection range. Particle / Gray scale algorithm is used to determine which algorithm is used to detect the specific measure. The result of particle analysis is shown in figure 10. Figure 10: Particle analysis 5. Conclusion The paper presents a fast and feasible system for precision recognition and quick selection of the seeds with small particles. The system was described and visual algorithm analysis is conducted. Industrial camera in the system is used to collect seeds image. The image is transmitted to personal computer by image acquisition board. In the visual image processing images are processed to provide feedback to PLC. Fast precision selection for carrot seed particles is achieved. Experimental results show that the system can achieve a single grain seed rate which is more than 92%. And the spacing can be controlled (The minimum spacing is 5 cm).The utilization of seeds is greatly improved, and the work efficiency is 20 times as artificial efficiency. Acknowledgment This paper is supported by the National Natural Science Foundation of China (Grant No.51205336), the Natural Science Foundation of Fujian Province (Grant No.2013J05086) and the Science and Technology Plan Project of Fujian Province (Grant No. 2013H0050). References Blayvas I., Bruckstein A., Kimmel R., 2006, Efficient computation of adaptive threshold surfaces for image binarization[J]. Pattern Recognition, 39(1),89-101,10.1016/j.patcog.2005.08.011 Giachetti A., Asuni N., 2011, Real-time artifact-free image upscaling, Image Processing, IEEE Transactions on, 20(10), 2760-2768,10.1109/TIP.2011.2136352 Lin L., Hu R., Wang C., 2010, The Development of Vacuum Adsorption-type Precision Seeder.DEVELOPMENT & INNOVATION OF MACHINERY & ELECTRICAL PRODUCTS,23(4), 52- 54,10.3969/j.issn.1002-6673.2010.04.020 Mery D., Carrasco M., 2005, Automated multiple view inspection based on uncalibrated image sequences, Lecture Notes in Computer Science,3540,1238–1247,10.1007/11499145_125 Rommelse J.R., Lin H.X., Chan T.F., 2004,Efficient active contour and k-means algorithms in image segmentation, Scientific Programming,12 (2) , 101–120,10.1155/2004/701965 Wan P., Long C.J., Ren Y.L., 2012, Application Progress of the Machine Vision Technology in the Quality Inspection of the Rice, 34(7),1-5,10.3969/j.issn.1003-188X.2012.07.001 Wang J.X., Li Y.W., 2008, The Application and Design of PLC in Seeding Machine, Journal of Agricultural Mechanization Research, 7,140-142,10.3969/j.issn.1003-188X.2008.07.043 Wang W., Wong Y.S., Hong G.S., 2005, Flank wear measurement by successive image analysis, Computers in Industry, 56 (8), 816–830, 10.1016/j.compind.2005.05.009 Yeh C., Perng D.B., 2005, A reference standard of defect compensation for leather transactions, The International Journal of Advanced Manufacturing Technology,25(11), 1197–1204,10.1007/s00170-003- 1945-y 1032 http://c.wanfangdata.com.cn/Periodical-jdcpkfycx.aspx http://c.wanfangdata.com.cn/periodical/jdcpkfycx/2010-4.aspx http://dx.doi.org/10.1155/2004/701965 http://c.wanfangdata.com.cn/periodical/njhyj/2012-7.aspx