Macine Vision System for Automatic Weeding Strategy in Oil Palm Plantation using Image Filtering Tecnique Kamarul Hawari Gazali, Mod. Marzuki Mustafa, and Aini Hussain Abstract Macine vision is an application of computer vision to automate conventional work in industry, manufacturing or any oter field. Nowadays, people in agriculture industry ave embarked into researc on implementation of engineering tecnology in teir farming activities. One of te precision farming activities tat involve macine vision system is automatic weeding strategy. Automatic weeding strategy in oil palm plantation could minimize te volume of erbicides tat is sprayed to te fields. Tis paper discusses an automatic weeding strategy in oil palm plantation using macine vision system for te detection and differential spraying of weeds. Te implementation of vision system involved te used of image processing tecnique to analyze weed images in order to recognized and distinguised its types. Image filtering tecnique as been used to process te images as well as a feature extraction metod to classify te type of weed images. As a result, te image processing tecnique contributes a promising result of classification to be implemented in macine vision system for automated weeding strategy. Keywords Macine vision, Automatic Weeding Strategy, filter, feature extraction. I. INTRODUCTION EEDING strategy in oil palm plantation plays a Wsignificant role to ensure te greater production yields [1]. Manual sprayer wic is involving labor workers carrying a backpack of erbicide and manually sprayed weed in te field is known very inefficient and dangerous to uman being. At present, erbicides are uniformly applied in te field, even toug researcers ave sown tat te spatial distribution of weed is non-uniform. If tere are means to detect and identify te non-uniformity of te weed spatial distribution, ten it would be possible to reduce erbicide quantities by application only were weeds are located [2], [3]. Consequently, an intelligent system for automated weeding strategy is greatly needed to replace te manual spraying system tat is able to protect te environment and at te same time, produce better and greater yields. Appropriate Manuscript received April 22, 2008. K. H. Gazali is wit te Faculty of Electrical and Electronics Engineering, Universiti Malaysia Paang, Kuantan, Malaysia (E-mail: kamarul@ump.edu.my). M. M. Mustafa and A. Hussain are wit te Department of Electrical, Electronic and Systems Engineering, Faculty of Engineering, Universiti Kebangsaan Malaysia, 43600 UKM Bangi, Malaysia. spraying tecnology and decision support systems for precision application of erbicides are available, and potential erbicide savings of 30% to 75% ave been demonstrated [4]. Te proposed metod of automatic weeding strategy uses macine vision system is to detect te existence of weed as well as to distinguis its types. Te core component of macine vision system is its image processing tecnique tat can detect and discriminate te type of weed namely as narrow and broad. Macine vision metods are based on digital images, witin wic, geometrical, utilized spectral reflectance or absorbance patterns to discriminate between narrow and broad weed. Macine vision metods ave been used to sow sape features to discriminate between corn and weeds [5]. Oter studies classified te scene by means of color information [6]. In [7], statistical approac as been used to analyze te weed presence in cotton fields. It was reported tat, te uses of statistical approac gave very weak detection wit 15% of false detection rate. In tis work, we report te image processing tecniques tat ave been implemented wic is focused on te filtering tecnique as well as feature vector extraction and selection of te weed images. Filter tecniques as very close relation to edge detection. Selective edge detection and suppression of noise as been usually acieved by varying te filter size. Small filter sizes preserve ig-resolution detail but consequently include inibitive amounts of noise, wile larger sizes effectively suppress noise but only preserve lowresolution detail [8]. Multi-scale filter function was proposed as a solution for effective noise reduction, and involves te combination of edge maps generated at different filter sizes [8]. Multi scale size of filter function can be used to determine te clear of edge detection. As mentioned earlier, a weeding strategy is an important part element in palm plantation industry to ensure a palm oil production meets quality control standard. In tis work, we will focus on te commonly found weed types in oil palm plantations wic are classified and identified as narrow and broad weed. Fig. 1 sows te narrow and broad weed type in different image condition. Tese types of image will be processed using filtering tecnique and extract te features using continuity measure feature extraction metod. PWASET VOLUME 31 JULY 2008 ISSN 1307-6884 655 193
Weed Image Pre-processing RGB to gray Filter Fig. 1 Images of narrow and broad weed to be classified Feature Extraction II. METHODOLOGY Te advancement of digital image processing provides an easy way to process weed image. Tere are many tecniques of image processing tat can be used for detection and classification of weed. One of te common tecniques uses in image processing is filter [9]. Te ordinary filters suc as low pass, ig pass, Gaussian, Sobel and Prewitt are used to enance te raw image as well as to remove unwanted signal in te original image [10]. Te existing type of filter was designed for general purpose. Tus, it sould be modified to fulfill targeted application. In tis paper, low pass and ig pass filter ave been used to analyze te weed images and we proposed a new feature extraction tecnique. Tis is to produce a set of feature vector to represent narrow and broad weed for classification. Fig. 2 sows a block diagram of overall metodology of image processing tecnique proposed. Generally, weed can be classified into broad and narrow. As te first step, te image of weed is captured using digital camera in RGB format wit 240x320 resolutions. Te captured image (offline) ten converted to gray scale to minimize te array of image. In te image processing part, it is easy to process te pixels in te two dimensional gray images rater tan RGB tree dimensional array. Additionally, te filter tecnique is involved of convolution metod wic is very fast to process in two dimensional arrays to produce an output tat can be used for feature extraction metod. Operation of filtering tecnique doesn t cange te size of data images 240x320 and it is only filtering te unwanted signal tat designated by filter function suc as low pass, ig pass etc. Te large value of data is difficult to analyze and process wit te purpose of represent te target object. Terefore, it is important to minimize te size of filter output data by applying a feature extraction tecnique. Te feature extraction tecnique continuity measure (CM) as been proposed to extract and minimized te size of pixels value of output filter. Te final stage in te image processing metod is to classify weed according to its types - narrow and broad weed. Classification Narrow, Broad Fig. 2 Metodology of image processing using filter tecnique Algoritm development in te image processing metod can be considered as a brain to te macine vision system. Te algoritms working to detect, discriminate as well as classify te target object in order to implement in real application. Te above metodology discussed a tecnique to develop software engine. As for implementation in real application, te software engine needs to interface wit te mecanical structure to respond receiving signal of detection. An electronic interface circuits used to ensure te data can be transfer efficiently. A prototype of real time sprayer structure weeding strategy as been sown in Fig. 3. Te mecanical structure equipped wit a webcam camera, two tanks to carry different types of erbicide, an agriculture type of liquid sprayer and an electronic board for interfacing wit software engine. III. FILTERING TECHNIQUE Te basic concept of filter tecnique is to detect edge of an object. Smoot or sarp transitions in an image contribute significantly to te low and ig frequency content in te image. A two dimensional ideal low pass filter or also known as smooting spatial filters is sown below: 1 D0 H ( (1) 0 D0 Were D 0 is a specified nonnegative quantity and D( is te distance from point ( to te origin of te frequency plane. A two dimensional ideal ig pass filter is one wose transfer function satisfies te relation 0 D0 H ( (2) 1 D0 PWASET VOLUME 31 JULY 2008 ISSN 1307-6884 656 194
Were D 0 is te cutoff distance measured from te origin of te frequency plane and D( is te distance from point ( to te origin of te frequency plane. Te above low and ig pass filter as been modified to applied in te weed detection wit different scale of filter function as describe below. Five differences size of scale of low and ig pass filter as sown in Fig. 4 as been tested to te weed images to find te best scaling factor tat can used for edge detection. Fig. 3 Te sprayer structure of te automated weeding strategy 1or 2or 1 1 1 1 1 1 11 11 1 1 11 1 1 1 1 1ver 2ver 3or 3ver 4or 5or 1 1 11 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 11 4ver 5ver 1 1 11 1 1 1 111 1 1 1 1 1111 1 1 1 1 1 11111 1 1 1 1 1 1 111111 Webcam camera 2 tanks Nozzle for sprayer Te next step is to analyze te output of bot filters so tat features can be extracted to represent te narrow and broad weed. Based on te output image, we found tat te narrow output filter ad neigborood pixel values connected to eac oter and looked like a straigt line. Te significant differences of bot output filters can be extracted by implementing continuity measure. Te continuity measure tecnique can be illustrated as sown in Fig. 5. Te neigborood pixel values can be measured by cecking its continuity of 3, 5, 7 or 10 wit different angel. CM feature extraction can be described as follows: Measure te continuity of pixel values using values of eiter 3, 5, 7 or 10 If tere is no continuity, te pixel values is set to zero For example, if continuity = 3 wit angle 0 0, te following step will be taken o If X n &X n+1 &X n+2 = 1, remain te pixel value 1 o If X n &X n+1 &X n+2 1 all te pixel values set to 0. o n X n Te feature vector is expected to give a significant different of narrow and broad based on teir respective output of filter. Feature vector obtained from te CM tecnique as a different value to represent narrow and broad weed. Te following Fig. 6 sows a plot grap of narrow and broad feature vectors in two different types of filter. Te orizontal filter is a low pass function was plotted te values versus vertical filter of ig pass function. It was found tat te narrow and broad feature vectors were located at two different groups of values and it s easy to discriminate te narrow and broad weed. A linear classification tool y=mx+c was used to determine te best tresold equation for classification. 135 0 90 0 450 Continuity 3, 5, 7, 10 Fig. 5 Continuity measurement tecnique of output filter Fig. 4 Five scales of filter function PWASET VOLUME 31 JULY 2008 ISSN 1307-6884 657 195
Pixel values of vertical filter Linear equation Pixel values of orizontal filter Fig. 6 Feature vector of narrow and broad class IV. RESULT AND DISCUSSION Te filtering tecnique togeter wit feature extraction continuity measure was applied to te narrow and broad weed image. More tan 500 images ave been tested to verify te classification performance. Figs. 7 and 8 sows te original image and te output of low and ig pass filter wit a function describe in equations (1) and (2). From te figure, it is clearly seen tat, te low and ig pass filter as produced an edge of object in te image. Te edge of object in black and wite pixel values as been analyzed using CM tecnique to extract its feature vector. Figs. 9-11 sow te plot values of feature vector wit different CM measurement. Feature vector set obtained from te CM tecnique as been used to identify a linear classification equation. Wenever te feature vector scatter into two different groups, a linear classification equation can be easily defined wit minimum error could be expected. It is clearly seen tat te feature vector of scale 1 and angle 450 as a value overlap to eac oter. Te feature vector values would give error to classification performance. However, te performance as been improved by increasing te scale of CM tecnique. It can be seen in figure 10 and 11 were te values of feature vector is scattered into two different groups and no overlap occurred. Te overall performance of te tecniques for classification broad and narrow weed is depicted in Table I and II. (a) (b) (c) Fig. 8 (a) Weed image, (b) Output of vertical filter (c) Output of orizontal filter. V. CONCLUSION Te CM tecnique wit angle of 45 and scale 3 obtained te best result wit correct classification rate of 86.1% and 88.4% for narrow and broad weed respectively. Sligt drop in te performance was noted wen te scale were set to 1, 2 and 4 wile maintaining te angle at 45. We ave found tat te CM tecnique wit angle 45 is te most suitable angle since te best classification result is acieved wen tis value is used. Furter work is ongoing to improve te tecnique eiter in te part of te feature extraction or classification. Fig. 9 Feature vectors of CM at scale 1 and angle 45 0 (a) (b) (c) Fig. 7 (a) Narrow image, (b) Output of vertical filter (c) Output of orizontal filter Fig. 10 Feature vectors of CM at scale 2 and angle 45 0 PWASET VOLUME 31 JULY 2008 ISSN 1307-6884 658 196
Fig. 11 Feature vectors of CM at scale 3 and angle 45 0 TABLE I CLASSIFICATION RATE OF NARROW AND BROAD WEED FOR 0 0 AND 45 0 Vertical 0 0 45 0 orizontal N(%) B(%) N(%) B(%) Scale 1 40.2 40.7 80.0 80.4 Scale 2 41.7 42.4 82.9 83.7 Scale 3 43.0 43.8 86.1 88.4 Scale 4 43.1 43.5 86.3 87.9 TABLE II CLASSIFICATION RATE OF NARROW AND BROAD WEED FOR 90 0 AND 135 0 Vertical 90 0 135 0 orizontal N(%) B(%) N(%) B(%) Scale 1 70.8 71.2 70.8 71.2 Scale 2 73.7 74.2 73.7 74.2 Scale 3 74.5 75.8 74.5 75.8 Scale 4 74.4 74.9 74.4 74.9 REFERENCES [1] I. Azman, A. S. Mod and N. Mod, Te Production Cost of Oil Palm Fres Fruit Bunces: te Case of Independent Smallolders in Joor. Oil Palm Economic Journal, 3(1), 1963 [2] J. L. Lindquist, A. J. Dieleman, D. A. Mortensen, G. A. Jonson, D. Y. Wyse-Pester, Eonomic importance of managing spatially eterogeneous weed populations. Weed Tecnology, 12, 1998, 7-13. [3] A. G. Man, G. Rabatel, L. Assemat, M. J. Aldon, Weed Leaf Image Segmentation by Deformable Templates. Automation and Emerging Tecnologies, Silsoe Researc Institute, 2001, 139 146. [4] T. Heisel, S. Cristensen, A. M. Walter, Wole-field experiments wit site-specific weed management. In: Proceedings of te Second European Conference on Precision Agriculture, Odense, Denmark, Part 2, 1999, 759 768. [5] G. E. Meyer, K. V. Bargen, D. M. Woebbecke, D.A. Mortensen, Sape features for identifying young weed using image analysis. American Society of Agriculutre Engineers, St. Josep, MI USA., 94: 3019, 1994 [6] S. I. Co, D. S. Lee and J. Y. Jeong, Weed-plant discrimination by macine vision and artificial neural network. Biosyst. Eng 83(3), 1998: 275-280. [7] A. Victor, R. Leonid, H. Amots, Y. Leonid, Weed Detection In Multi- Spectral Images Of Cotton Fields. Computers and Electronics in Agriculture 47(3), 2005: 243-260 [8] M. Bas Gaussian-based edge-detection metods a survey. IEEE Trans. Syst. Man Cybern. C Appl. Rev. 32, 2002, 252 260. [9] P. M. Graniatto, H. D. Navone, P.F. Verdes, and H. A. Ceccatto, Weed Seeds Identification By Macine Vision. Computers and Electronics in Agriculture 33, 2002, 91-103. [10] R. C. Gonzales, R. E. Woods,Digital image processing, Addison-Wesley Publising Company, 1992, New York. PWASET VOLUME 31 JULY 2008 ISSN 1307-6884 659 197