Machine Vision System for Automatic Weeding Strategy in Oil Palm Plantation using Image Filtering Technique

Machine vision is an application of computer vision to automate conventional work in industry, manufacturing or any other field. Nowadays, people in agriculture industry have embarked into research on implementation of engineering technology in their farming activities. One of the precision farming activities that involve machine vision system is automatic weeding strategy. Automatic weeding strategy in oil palm plantation could minimize the volume of herbicides that is sprayed to the fields. This paper discusses an automatic weeding strategy in oil palm plantation using machine vision system for the detection and differential spraying of weeds. The implementation of vision system involved the used of image processing technique to analyze weed images in order to recognized and distinguished its types. Image filtering technique has been used to process the images as well as a feature extraction method to classify the type of weed images. As a result, the image processing technique contributes a promising result of classification to be implemented in machine vision system for automated weeding strategy.

spraying technology and decision support systems for precision application of herbicides are available, and potential herbicide savings of 30% to 75% have been demonstrated [4].
The proposed method of automatic weeding strategy uses machine vision system is to detect the existence of weed as well as to distinguish its types.The core component of machine vision system is its image processing technique that can detect and discriminate the type of weed namely as narrow and broad.Machine vision methods are based on digital images, within which, geometrical, utilized spectral reflectance or absorbance patterns to discriminate between narrow and broad weed.
Machine vision methods have been used to show shape features to discriminate between corn and weeds [5].Other studies classified the scene by means of color information [6].In [7], statistical approach has been used to analyze the weed presence in cotton fields.It was reported that, the uses of statistical approach gave very weak detection with 15% of false detection rate.
In this work, we report the image processing techniques that have been implemented which is focused on the filtering technique as well as feature vector extraction and selection of the weed images.Filter techniques has very close relation to edge detection.Selective edge detection and suppression of noise has been usually achieved by varying the filter size.Small filter sizes preserve high-resolution detail but consequently include inhibitive amounts of noise, while 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 the combination of edge maps generated at different filter sizes [8].Multi scale size of filter function can be used to determine the 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 this work, we will focus on the commonly found weed types in oil palm plantations which are classified and identified as narrow and broad weed.Fig. 1 shows the narrow and broad weed type in different image condition.These types of image will be processed using filtering technique and extract the features using continuity measure feature extraction method.The advancement of digital image processing provides an easy way to process weed image.There are many techniques of image processing that can be used for detection and classification of weed.One of the common techniques uses in image processing is filter [9].The ordinary filters such as low pass, high pass, Gaussian, Sobel and Prewitt are used to enhance the raw image as well as to remove unwanted signal in the original image [10].The existing type of filter was designed for general purpose.Thus, it should be modified to fulfill targeted application.In this paper, low pass and high pass filter have been used to analyze the weed images and we proposed a new feature extraction technique.This is to produce a set of feature vector to represent narrow and broad weed for classification.Fig. 2 shows a block diagram of overall methodology of image processing technique proposed.
Generally, weed can be classified into broad and narrow.As the first step, the image of weed is captured using digital camera in RGB format with 240x320 resolutions.The captured image (offline) then converted to gray scale to minimize the array of image.In the image processing part, it is easy to process the pixels in the two dimensional gray images rather than RGB three dimensional array.
Additionally, the filter technique is involved of convolution method which is very fast to process in two dimensional arrays to produce an output that can be used for feature extraction method.Operation of filtering technique doesn't change the size of data images 240x320 and it is only filtering the unwanted signal that designated by filter function such as low pass, high pass etc.The large value of data is difficult to analyze and process with the purpose of represent the target object.Therefore, it is important to minimize the size of filter output data by applying a feature extraction technique.The feature extraction technique continuity measure (CM) has been proposed to extract and minimized the size of pixels value of output filter.The final stage in the image processing method is to classify weed according to its types -narrow and broad weed.Algorithm development in the image processing method can be considered as a brain to the machine vision system.The algorithms working to detect, discriminate as well as classify the target object in order to implement in real application.The above methodology discussed a technique to develop software engine.As for implementation in real application, the software engine needs to interface with the mechanical structure to respond receiving signal of detection.An electronic interface circuits used to ensure the data can be transfer efficiently.A prototype of real time sprayer structure weeding strategy has been shown in Fig. 3.The mechanical structure equipped with a webcam camera, two tanks to carry different types of herbicide, an agriculture type of liquid sprayer and an electronic board for interfacing with software engine.

III. FILTERING TECHNIQUE
The basic concept of filter technique is to detect edge of an object.Smooth or sharp transitions in an image contribute significantly to the low and high frequency content in the image.A two dimensional ideal low pass filter or also known as smoothing spatial filters is shown below: Where D 0 is a specified nonnegative quantity and D(u,v) is the distance from point (u,v) to the origin of the frequency plane.
A two dimensional ideal high pass filter is one whose transfer function satisfies the relation

ver hor ver hor h h h h
Where D 0 is the cutoff distance measured from the origin of the frequency plane and D(u,v) is the distance from point (u,v) to the origin of the frequency plane.
The above low and high pass filter has been modified to applied in the weed detection with different scale of filter function as describe below.Five differences size of scale of low and high pass filter as shown in Fig. 4 has been tested to the weed images to find the best scaling factor that can used for edge detection.The next step is to analyze the output of both filters so that features can be extracted to represent the narrow and broad weed.Based on the output image, we found that the narrow output filter had neighborhood pixel values connected to each other and looked like a straight line.The significant differences of both output filters can be extracted by implementing continuity measure.The continuity measure technique can be illustrated as shown in Fig. 5.The neighborhood pixel values can be measured by checking its continuity of 3, 5, 7 or 10 with different angel.CM feature extraction can be described as follows: Measure the continuity of pixel values using values of either 3, 5, 7 or 10 If there is no continuity, the pixel values is set to zero For example, if continuity = 3 with angle 0 0 , the following step will be taken The feature vector is expected to give a significant different of narrow and broad based on their respective output of filter.Feature vector obtained from the CM technique has a different value to represent narrow and broad weed.The following Fig. 6 shows a plot graph of narrow and broad feature vectors in two different types of filter.The horizontal filter is a low pass function was plotted the values versus vertical filter of high pass function.It was found that the narrow and broad feature vectors were located at two different groups of values and it's easy to discriminate the narrow and broad weed.A linear classification tool y=mx+c was used to determine the best threshold equation for classification.The filtering technique together with feature extraction continuity measure was applied to the narrow and broad weed image.More than 500 images have been tested to verify the classification performance.Figs.7 and 8 shows the original image and the output of low and high pass filter with a function describe in equations ( 1) and ( 2).From the figure, it is clearly seen that, the low and high pass filter has produced an edge of object in the image.The edge of object in black and white pixel values has been analyzed using CM technique to extract its feature vector.Figs.9-11 show the plot values of feature vector with different CM measurement.
Feature vector set obtained from the CM technique has been used to identify a linear classification equation.Whenever the feature vector scatter into two different groups, a linear classification equation can be easily defined with minimum error could be expected.It is clearly seen that the feature vector of scale 1 and angle 450 has a value overlap to each other.The feature vector values would give error to classification performance.However, the performance has been improved by increasing the scale of CM technique.It can be seen in figure 10 and 11 where the values of feature vector is scattered into two different groups and no overlap occurred.The overall performance of the techniques for classification broad and narrow weed is depicted in Table I and II.

V. CONCLUSION
The CM technique with angle of 45° and scale 3 obtained the best result with correct classification rate of 86.1% and 88.4% for narrow and broad weed respectively.Slight drop in the performance was noted when the scale were set to 1, 2 and 4 while maintaining the angle at 45°.We have found that the CM technique with angle 45° is the most suitable angle since the best classification result is achieved when this value is used.Further work is ongoing to improve the technique either in the part of the feature extraction or classification.

Fig. 1
Fig. 1 Images of narrow and broad weed to be classified

Fig. 2
Fig. 2 Methodology of image processing using filter technique

Fig. 3
Fig. 3 The sprayer structure of the automated weeding strategy

Fig. 5
Fig. 5 Continuity measurement technique of output filter

Fig. 6
Fig. 6 Feature vector of narrow and broad class

Fig. 9
Fig. 9 Feature vectors of CM at scale 1 and angle 45 0

Fig. 10
Fig. 10 Feature vectors of CM at scale 2 and angle 45 0

Fig. 11
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

TABLE II CLASSIFICATION
RATE OF NARROW AND BROAD WEED FOR 90 0 AND 135 0