Sunteți pe pagina 1din 3

Implementation & Analysis of Edge Detection

Algorithms for Pest Detection in Plants


Mr. Srinivas K S, Mrs. USHA B S#1, Dr. S Sandya#1, Mr.Sudhir Rao Rupanagudi#2

#1 : Dept of ECE, VTU


Channasandra, Subramanyapura PO,
Bengaluru
sandya9prasad@gmail.com
bsusha@gmail.com

#2: Technical Consultant –Digital FPGA Design Engineer,


WorldServe Education, Bengaluru
worldserve.education@gmail.com

Abstract— There are different algorithms to perform edge detection:


This paper is written keeping in mind the best interests of
farmers worldwide. The growth of pests on yielding crops a) Sobel
is a nuisance that is faced by agriculturists. A pest is any b) Prewitt
organism that spreads disease, causes destruction or is c) Canny
otherwise a nuisance. Some examples of pests are d) Roberts
mosquitoes, rodents, and weeds. The most common pests e) Laplacian of Gaussian
affecting plants are Aphids, Fungus, Gnats, Flies, Thrips,
Slugs, Snails, Mites and Caterpillars. There is a pressing
requirement to detect these pests at an early stage and II. DIFFERENT ALGORITHMS IN DETAIL
suggest remedies so that much of the damage can be The various edge detection algorithms mentioned above,
avoided and yield can be improved. This can be achieved involve a two dimensional (2-D) spatial gradient measurement
through an Automatic pest control system. It uses image on the image. This is performed by convolving two special 2-
processing algorithms which detect growth of pests. This D matrices of coefficients with the input image. One of the 2-
system consists of an Image Capturing Unit (ICU), Mote, D matrices is convolved from left to right, horizontally over
Image Transfer Unit (ITU), Host system which performs the image (Horizontal mask - Gx), whilst the other is
image processing & a database. As part of the host system convolved in the vertical axis (Vertical Mask - Gy). The
image processing unit, an edge detection algorithm is used resultant images after convolution are combined to obtain the
to detect pests. The results of implementing various edge gradient magnitude of the image using Equation 1. This
detection algorithms and the success rate of detecting pests highlights the edges of various objects in the image.
using these algorithms is presented in the paper.
Resultant Image = [Gx2+Gy2] 1/2 (1)
Keywords— Automatic Pest Control System, Edge detection,
Image processing, Pest detection, Canny, Roberts, Laplacian Coefficients vary based on the method of edge detection
of Gaussian, Prewitt, Sobel Edge Detection, Segmentation chosen. The different 2-D matrices of Gx and Gy for different
methods have been mentioned in the following sections.

I. INTRODUCTION A. Sobel Edge Detection Algorithm [2]


Edges characterize boundaries of an image. Edges in -1 0 +1
images are areas with strong intensity contrasts – a jump in -2 0 +2
intensity from one pixel to the next. Edge detecting an image Horizontal Coefficients (Gx) =
-1 0 +1
significantly reduces the amount of data and filters out useless
information, while preserving the important structural
-1 -2 -1
properties in an image [1]. This property could in turn be used
Vertical Coefficients (Gy) = 0 0 0
to detect the boundaries of pests affecting plants.
+1 +2 +1
B. Prewitt Edge Detection Algorithm[3]

-1 0 +1
Horizontal Coefficients (Gx) = -1 0 +1
-1 0 +1

-1 -1 -1
Vertical Coefficients (Gy) = 0 0 0
+1 +1 +1

C. Canny Edge Detection algorithm[4]

-1 0 +1
Horizontal Coefficients (Gx) = -2 0 +2
-1 0 +1

+1 +2 +1
Vertical Coefficients (Gy) = 0 0 0
-1 -2 -1 Figure 1: Leaf affected by pests

D. Roberts Edge Detection Algorithm[5]

It is interesting to note that this method utilizes a 2-D


matrix of 2*2 instead of 3*3 mask.

Horizontal Coefficients (Gx) = -1 0


0 +1

Vertical Coefficients (Gy) = 0 -1


+1 0

E. Laplacian of Gaussian Edge Detection algorithm[6]


Figure 2 : Sobel Edge Detected Output
0 -1 0
Horizontal Coefficients (Gx) = -1 4 -1
0 -1 0

-1 -1 -1
Vertical Coefficients (Gy) = -1 8 -1
-1 -1 -1

III. MATLAB IMPLEMENTATION AND SIMULINK

The five algorithms introduced in Section II were


implemented using MATLAB. A standard leaf affected by
different pests (fig 1) was used as our input.
After performing edge detection on the leaf affected by the
pest, a simple segmentation was performed by subtracting the
edge detected image with an image of a leaf unaffected by
pests. The results obtained are shown in fig. 2, 3, 4, 5 and 6.
Figure 3 : Prewitt Edge Detected Output
IV. RESULTS
On a visual comparison of the images obtained (fig. 2-6)
using the aforementioned algorithms for edge detection, it can
be clearly seen that the edge detection performed using the
Prewitt Algorithm provides the finest details of the pest, in
comparison with the other algorithms. This has been encircled
and shown in Figure 3.
Robert’s edge detection (Fig. 5) is disadvantageous due to
poor quality of the output image obtained. It must be noted
that this algorithm is slower in implementation since
convolution is performed using a 2*2 matrix instead of a 3*3.
Laplacian of Gaussian Algorithm is also disadvantageous
due to presence of large amount of artifacts and noise as
shown in Figure 6. The pests are not clearly visible in
comparison with the other cases.

Figure 4 : Canny Edge Detected Output V. CONCLUSIONS


In this paper we have presented a comparative study of pest
detection in plants using different edge detection algorithms
using Matlab. It can be concluded that the Prewitt algorithm
provides perfect results in detection and highlighting of pests.
It would be the algorithm of choice when hardware
implementation of the image processor for pest detection is
performed. Robert’s edge detection and Laplacian of Gaussian
Algorithm is best to be avoided for the same purpose.

REFERENCES
[1] Horacio M. González-Velasco et. al. ―Neural-networks-
based edges selector for boundary extraction problems.‖,
Department of Electronics and Electromechanical Engineering,
University of Extremadura, E-06071, Badajoz, Spain

[2] Wenshuo Gao,Xiaoguang Zhang, Lei Yang,Huizhong Liu,


Figure 5 : Roberts Edge Detected Output ―An improved Sobel edge detection‖, in Computer Science
and Information Technology (ICCSIT), 2010 3rd IEEE
International Conference on 9-11 July 2010

[3] Wenshuo Gao,Lei Yang,Xiaoguang Zhang,Bin


Zhou,Chunxi Ma, ―Based on soft-threshold wavelet de-
noising combining with Prewitt operator edge detection
algorithm‖, in Education Technology and Computer (ICETC)

[4] Yuancheng Luo,Duraiswami. R, ―Canny edge detection on


NVIDIA CUDA‖, in in: Computer Vision and Pattern
Recognition Workshops, 2008. CVPRW '08. IEEE Computer
Society Conference on 23-28 June 2008,

[5] Rosenfeld, Azriel, ―The Max Roberts Operator is a


Hueckel-Type Edge Detector‖, in Pattern Analysis and
Machine Intelligence, IEEE Transactions on Jan. 1981,

[6] Bliton, A.C, Patton, M.J, Rolli, M.L, Roos, K.P, Taylor,
S.R, ―Microscopic motion analysis: Laplacian-of-Gaussian
Figure 6 : Laplacian Of Gaussian Edge Detected Output masks for subpixel edge detection‖, in Engineering in
Medicine and Biology Society, 1988. Proceedings of the
Annual International Conference of the IEEE

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