Sunteți pe pagina 1din 4

2007 IEEE International Symposium

on Signal Processing and Information Technology

Implementation of Image Processing Technique in Real Time Vision System for


Automatic Weeding Strategy
Mohd. Marzuki Mustafa, Aini Hussain, Kamarul Hawari Ghazali, Slamet Riyadi
Department of Electrical, Electronic and Systems Engineering
Faculty of Engineering, Universiti Kebangsaan Malaysia
43600 UKM Bangi, Malaysia.

Abstract - A weed can be thought of as any plant growing in the sensors technologies for selective application of herbicide.
wrong place at the wrong time and doing more harm than good. Selective application of herbicides requires automatic
Weeds compete with the crop for water, light, nutrients and space, detection and evaluation of weeds in the field [1]. Several
and therefore reduce crop yields and also affect the efficient use of methods are available for such automatic detection, among
machinery. The most widely used methodfor weed control is to use which are those based on machine vision [2] [3] [4]. Machine
agricultural chemicals (herbicides and fertilizer products). This vision system is based on digital image processing is found to
heavy reliance on chemicals raises many environmental and be the best sensor detection as its operation is similar to the
economic concerns, causing manyfarmers to seek alternativesfor human eye. The main objective of the research presented in
weed control in order to reduce chemical use in farming. Since
hand labor is costly, an automated weed control system may be this paper is to develop real time system that can interface
economically feasible. A real-time precision automated weed with the mechanical structure spraying system to be used as a
control system could also reduce or eliminate the need for weeding strategy in oil palm plantation. Two image
chemicals. In this research, an intelligent real-time automatic processing techniques were considered and implemented
weed control system using image processing has been developed to namely; gray level co-occurrence matrix (GLCM) and Fast
identify and discriminate the weed types namely as narrow and Fourier transform (FFT).
broad. The core component of vision technology is the image
processing to recognize type of weeds. Two techniques of image II METHODOLOGY
processing, GLCM and FFT have been used and compared to find
the best solution of weed recognition for classification. The
developed machine vision system consists of a mechanical With the advancement of computer technology, machine-
structure which includes a sprayer, a Logitech web-digital camera, vision systems have become a possible solution for weed
12v motor coupled with a pump system and a small size CPU as a classification [5] (Graniatto et al., 2002). The main
processor. Offline images and recorded video has been tested to the component in machine vision system is a digital image
system and classification result of weed shows the successful rate processing as well as its interfacing with hardware structure
is above 80%. system. The overall process of system development can be
Key words: Weed, herbicide, Real me, GLCM, FFT, Vision described in Figure 1. The automated sprayer system consists
System of an image acquisition, software engine, electronic
interfacing circuit and sprayer modules. In the image
I. INTRODUCTION acquisition module, a Logitech webcam (640x480 pixels) has
been used as an image collector. The original image is then
The current practice of weeding strategy in oil palm transferred to the software engine module or image pre-
plantation is undesirable. It was reported that more than processing and feature extraction. This is a critical module
30000 human sprayer workers work in oil palm plantations in because it must comply with the real time image processng
Malaysia. Pesticide used in manual sprayer is very dangerous requirements. Two techniques, GLCM and FFT have been
to the health and environment. In 2004, Consumer developed to enable the recognition of weed as either narrow
Association of Penang Malaysia (CAP) conducted a study of or broad weed. In real time system, there are many
11 oil palm plantations located in the northern states of uncertainties due to lighting conditioning, movements and
Malaysia. The study focused on women herbicide sprayers, sizes of the object etc. A new algorithm has been developed
their working conditions and the consequent health impacts. in this work that can respond positively to real time condition,
Work on an oil pahm plantation is back-breaking and and it has been successfully tested as aprototype system. As a
hazardous. Women herbicide sprayers are expected to carry result of image processing in software engine, the control will
an 18-litre (4-gallon) drum containing herbicide and are respond to sprayer module using electronic interface circuit.
expected to complete 14 to 16 rounds of spraying per day. This interface circuits used to ensure the data can be transfer
Tractor spraying is also conducted on some plantations efficiently. Finally, the sprayer module will respond due to
where big drums of herbicide are placedon both sides of the algorithm in Software Engine. A prototype of real time
tractor. Two workers will carry the pumps and spray as the sprayer structure weeding strategy has been shown in Figure
tractor moves. Health care considerations and environmental 2.
and economic factors are stimulating the development of

978-1 -4244-1 835-0/07/$25.00 ©2007 IEEE 632


Camera

Board
Nal
lNarrow

LoImage
ow

47
acquisition
Image acquisitin

41
Software Engine

_~ ~ ~ i7j=o
Broad
Broad

Image Processing Algorithm

4la
Electronic Interfacing
Circuit
Buffer IC, SSR
l1
Sprayer Module
12v motor dc, Pump
Fan nozzle, 2 tanks for

Camera
+ ~
herbicides
r

Fig. 1. Real time system prototype development

~ ~ ~
Tank for
~ herbicide
.........

processing algorithm and its function is to detect the target


object. In this research, we introduce and compare two
techniques namely as grey level co-occurrence matrix and
fast fourier transform. These two techniques will be used to
integrate with hardware to implement real time weeding
strategy.
~~~where
cSiodre

Sprayer
nozzle

Fig. 2. The sprayer structure of automated weeding strategy

III. IMAGE PROCESSING TECHNIQUE


The core component in real time vision system is the image
A. Grey Level Co-occurrence Matrix (GLCM)

GLCM is a tabulation of how often different combinations


of pixel brightness (grey levels) occurs in an image.
I1Basically, GLCM considers the relation between two
neighboring pixels at a time called the reference and the
neighbor pixel. The grey value relationships in a target are
ltransformed into ais aco-occurrence
occurrence matrix square matrixmatrix

analysis can be formulated as

C
N-1
E

B. Fast Fourier Transform (FFT)

F(k) lf(
N-1

n=O
in whichspace.

Pi j (i j)
Theto co-
it needs

respectively. Regularity equation can be defined as

R= E _
(2)
the i and]j represent the row and column of pixel valule,
be
transformed into a close approximation of a probability table.
This process is called matrix normalization. Normalization
involves dividing the square matrix by the sum of the values,
where i and j are coordinates of the co-occurrence matrix
space.

P = N-
vi,'
Vij
i,j=o

The key approach to extract feature vector of texture co-

The second technique that used in this research is FFT.


The FFT is an algorithm that computes the Discrete Fourier
Transform (DFT) of a function. The DFT F off is defined as
follows (Kammler):

(n)e 2fliknl/N

The DFT of a two dimensional function/(x, y), where x andy


both ranges from 0 to N - 1, is defined as follows:
(1)
occurrence analysis is by defining contrast and regularity as
feature vectors to represents the weed images. Contrast

(4)

(5)

633
1)N2 YY f(x, y)e N
F(k,l)=
N x=O y=0
y) E Vn (i j)
LMT = n n=

(6) E Dn (i, j)
Generally the derivation of FFT comes from the DFT (10)
definition. Here, we derive the DFT formula and letj(n) be a
function of n that spans from 0 to N - 1. We first separate f Where V1 is a line intensity value of the vertical FFT
into functions f' and f2 where f' J(2n) and f2 =J(2n + 1), coefficient and Dn is a line intensity value of the FFT
with n ranging from 0 to (N12 - 1). In other words, we simply coefficient taken at an angle of 450 from its center.
split f into two parts, one with domain even n and the other
with domain odd n. The FFT formula can be described as IV. PROTOTYPE SYSTEM
N1/2-1 The overall system of automatic weeding consists of two
F(k)
= Z f1 (n)e2mnkn/(N/2)... main parts, software system and the sprayer structure. The
n=O image processing algorithm (GLCM and FFT) need to be
N1 2-1 interfaced with the hardware to control motor pump. We have
+ e 2gk/N f2 (m)e 2ikm (N/2) used direct interfacing parallel port with matlab coding by
m=O using the data acquisition toolbox. The following figure 3
(7) shows how the software system was integrated with the
mechanical structure to become a complete real time system
Fourier transform of an image produced a complex valued for automatic weeding. The prototype consists of web camera
function, which must be translated into a real valued function Logitech (Pixel; VGA, Resolution; 640x480 (VGA),
to display as an image. We can either display the magnitude, 30fpsg352x288 and image format; RGB) to capture a narrow
the real part, or the imaginary part of the complex values. For and broad weed images and sent to the data acquisition
a complex number a + bi, the magnitude is defined as system through parallel port, processed by Matlab 6.5 GUI
program. The brain of software engine is the GLCM and FFT
aa2 +b2
+b
techniques which process the images in order to distinguish
and classify the both type of weed. An electronic system that
(8) consists of an interfacing circuit (buffer IC and solid state
relay) interfaces the motor pump to receive 5V TTL control
Where the real part is a and the imaginary part is b. signals from the software engine. The TTL signals gives input
The 2D-FFT coefficients represent the high and low to solid state relay to control the speed of 12-volt DC 7A
frequency values of the 2 dimensional images of both narrow electric motor of the pump so as to apply the herbicide
and broad weed type. It is difficult to classify the 2D-FFT through a fan nozzle. The complete system assemble is as
coefficient as the size of intensity value is the same as the shown in figure 2 and can be fixed onto a tractor for spraying
original image 240x320. In the image enhancement action.
application, these coefficients are used to remove the high
frequency components which are assumed as noise in the V. RESULT AND DISCUSSION
original image [6] [7]. However, for classification purposes,
these coefficients are useful to produce a set of feature The prototype real time system was tested using a recorded
vectors that can uniquely classify the target object. A method video which was taken at a location in the UPM oil palm
called Line Measure Technique (LMT) has been proposed to plantation. The recorded video of narrow and broad weed is
analyze the coefficient data so that classification of narrow considered to be a real time data and interfacing has been
and broad can be done effectively. The LMT is computed made to read the playback video file through matlab6p5. The
using the formulation shown below: recorded video of 30 minutes in duration comprising of
narrow and broad weed was captured under real condition
Im - Imm,n
2
(m: max row, n: max column) with various lighting, movement of camera as well as range
and position of target object. These conditions reflect the real
D=Im
D = + Im i-ij- +
j +Im
Im,: 2,J-2 + i- +. + Itime
- + 2-n, j-n testedcondition
with 1000 in asample
palm oil plantation.
of offline The tosystem
images was also
determine the
V = Imi + Imi -1 + Im1j2 + Im+..+ Im1,j_ classification error of both image samples for both techniques
(9) used. The following tables showed the result of correct
This can be simplify as classification rate of narrow and broad weed using offline
images and real time condition.

634
obtained 70.4% classification accuracy for the narrow
category and 72.5% for the broad.
Table 1. Classification with offline images

GLCM FFT
(a) n Narrow 81% 89l2%
Broad 81.5% 91%
WEED BUSTER
Ah 1td1i§dght P ttibidSpy0*ihg§ yt9rn Table 2. Classification with playback recorded video

GLCM FFT
........... ..................... ar ow 0.4 .6V

Broad 72.5% 81.1%

VI. CONCLUSION

IE. ~~ ~ ~ Tis paper has presented two techniques, namel the FFT
and GLCM, to recognize weed type as either narrow or broad.
It was shown that the FFT is better than the GLCM for the
(b) 4
nb) task. From the results, we anticipated that the developed
system using FFT can be realized for real time
implementation. The developed system is quite robust
considering that it can handle various conditions such as
aforementioned above. Further work is on-going to improve
the system and developed a more accurate and robust
algorithm in order to improve the performance of the current
technique especially in real time condition.
(c) REFERENCES
[1] Stafford, J.V., Benlloch, J.V., 1997. Machine-assisted detection of weeds
and weed patches. In: Stafford, J.V. (Ed), Precision Agriculture '97.
Technology, IT and Management, vol. II. BIOS Scientific Publishers
Ltd., pp. 511-5 18
[2] Wang, N., Zhang, N., Dowell, F.E., Sun, Y., Peterson, D.E., 2001. Design
of an optical weed sensor using plant spectral characteristics. Trans.
ASAE 44(2), 409-4 19.
[3] El-Faki, MS., Zhang , N., Peterson, D.E., 2000. Weed detection using
color machine vision. Trans ASAE 43(6), 1969-1978
[4] Cho, S eI.,Lee, D.S., Jeong, JY., 2002. Weed-plant discrimination by
machine vision and artificial neural network. Biosyst. Eng. 83(3), 275-
(d) 280
[5] Graniatto, P. M., Navone, H. D., Verdes, P. F., and Ceccatto, H. A., 2002.
Fig. 3. Component of Real Time System: (a) Logitech Weed seeds identification by machine vision. Computers and Electronics
algorithm, cin
Agriculture 33: 9 1-103.
offlinera,
ebcam
wffliebam camera, UIes
ima (b)
g GUToff image
image processing
processing algorithm,(c) [6] Glenn Hines, Zia-ur Rahman, Daniel Jobson,Glenn Woodell, 2000. DSP
electronic part to interface with motor pump, (d) motor water Implementation of the Retinex Image Enhancement Algorithm, NASA
PUMP Langley Research Center, Hampton, College of William & Mary,
Department of Applied Science, Williamsburg
Fromthe esuls,
From te it ca
reslts, be sen
canbe hat he FT
een thatthe FT tchniues ive
tecnique give
[7] Til Aach and Dietmar Kunz, 2004. Anisotropic Spectral Magnitude
Estimation Filters For Noise Reduction and Image Enhancement, Philips
better classification performance compared to the GLCM for GmbH Research Laboratories Weisshausstr, Aachen, Germany
both offline images and recorded video. When tested with the
offline images, the FFT achieve 89.200 and 9100 correct
classification rate for narrow and broad weed recognition
where as 81% and 81.5% classification rates were recorded
for the GLCM. As for testing with the recorded video data,
the FFT scores 80.60% and 81.10% for narrow and broad weed
recognition, respectively. The GLCM, on the other hand, only

635

S-ar putea să vă placă și