Plant Leaf Disease Detection and Classification Using Image Processing
Dip thesis
1. 1
1. INTRODUCTION
In earlier times fruits were sorted manually and it was very time consuming and laborious task.
Human sorted the fruits of the basis of shape, size and color. Time taken by human to sort the fruits
is very large therefore to reduce the time and to increase the accuracy, an automatic classification
of fruits comes into existence. To improve this human inspection and reduce time required for fruit
sorting an advance technique is developed that accepts information about fruits from their images,
and is called as Image Processing Technique. With this technique, it is easier to study the image
of fruits and get some information as a result which will help the user to classify them accordingly.
The features that can be extracted from image of some fruit are its size, shape, color and texture.
The features help the user to classify the fruit in different categories. There are several techniques
which can be used to extract the morphological features from an image. For size/ shape five edge
detection technique is used.
1.1 Shape
The automatic classification employs the human perception of the classification of fruits. In the
automatic classification a fruit is classified on the basis of shape and color. In the beginning fruits
are sorted on the basis of the shape. The term shape is commonly used to refer to the form of an
object or its external boundary (outline, external surface), and is dissimilar from other feature such
as color and texture. Shape modeling is to represent generic object geometry by a number of
models which account for the regularity and variety of natural objects. Shape modeling is the
foundation for object recognition under change of pace, deformation, and varying lighting
conditions. For shape based classification of fruits, various shape features are calculated. These
shape features of the fruit are area, perimeter, major axis length and minor axis length. The image
generally consists of pixels which includes RGB (Red, Green and blue) components.
1.2 Color
Human eyes sense the color of an object with the help of sensor and are of three types which
generate a signal to resolve the color of an object. For seeing an object of human Light play a
major role as it penetrates into the eyes and strike the retina, which is a light detector. Human eyes
are fascinated to color the object. Color object such as fruits and vegetables can be easy to
differentiate since it has different properties which are colored.
The model for identification of color has been used commonly in commercial fields and industrial
sectors. Color recognition system can describe image into information since most of object has a
2. 2
different color and this make it easy to recognize. Since human eyes have the limitation in
recognizing every color object, the system can overcome the disadvantages. Up until now, various
types of methods are used to evaluate the images of agricultural products that are vegetables and
fruits for detection and sorting purposes. The vegetables and fruits detection system use as an
image, contents descriptor that is able to explain the contents of the images or the visual features.
Fruits and vegetables recognition can give a lot of benefits to users. Both recognition systems can
give more precise result in analyzing the fruits and vegetable. For fruits recognition, one of the
applications of fruits recognition is to inspect the quality of the fruits for export purpose. For this
application, human eyes sometimes cannot differentiate the quality due to personal thought and
lack of experience. By using the system, fruit quality can be set and low quality fruits can be
separated from a good one. For vegetables, the same application can be applied. Vegetables were
easily damage cause of high temperature and can change drastically. With the help of vegetable
recognition, we can differentiate the quality between it.
1.3 Textures
Fruits are classified on the basis of shape, size and color and all the three features give good result.
However certain drawback comes with a notice when the fruit is classified on shape, size and color.
At the first time for classification of fruit the simple approach comes into mind is shaped, because
different fruits have different size and shape. So an approach is developed to classify the fruit on
shape and size bases, but it encounter a drawback .The drawback is when the fruits of the same
size are classified then there is ambiguity of the system to differentiate between the fruits. To
overcome this drawback a new feature is added which is color so the fruits that are difficult to
classify on the shape bases are easily classified on color bases. When a color feature is added to
shape feature, then the fruit classification enhance and gives good output. As the result is improved
with the addition of these features, but it also faces a problem when the fruits of the same size and
color are to be classified. To solve this problem an additional feature, texture, is analyzed which
is used for the classification of rocks and skin.
Texture is calculated by the outer part of an object which measures the roughness, coarseness and
smoothness. Texture is classified by the spatial distribution of gray levels in a neighborhood. It
also helps in surface determination and shape determination. The Gray level co-occurrence matrix
is used to calculate different texture feature . There are two methods can be used to calculate the
texture feature of the image. One is statistical texture analysis; the other is a structure of texture
analysis. The former is the most conventional. Statistical texture analysis methods include spatial
3. 3
autocorrelation method, Fourier power spectrum method, co-occurrence matrix method, gray level
difference statistics method and trip length statistics method. Texture features are used in many
crop classifications.A new technique for region-based skin color classification using texture
information. Color mapping co-occurrence matrix (CMCM) is used to extract the texture
information from skin image.
2. LITERATURE REVIEW
In agricultural science, images are the vital source of information and data. Mathematically
process or qualify of the photographic data is complicated. Image processing technology and
Digital image analysis avoid these troubles based on the development in microelectronic and
computers related to traditional photography. This tool helps to improve microscopic to a
telescopic visual range of an image and offers a possibility for their study. Image processing
technology has several applications in the field of agricultural. This application consists of
implementation of the color scanners or camera based hardware systems for inputting the images.
We made an effort to expand image analysis and processing technology to a large scale of
difficulties in the field of agriculture. We have tried to develop a solution which presents
classification problems in a most realistic way possible. Detection system is a ‘grand challenge’
for the computer vision to attain near human levels of detection. The fruits and vegetable
classification is useful in the supermarkets where prices for fruits purchased by a customer can be
determined automatically. Fruits and vegetable classification can also be used in computer vision
for the automatic sorting of fruits from a set, consisting of different kinds of fruit.
2.1 Shape based recognition
Shape based recognition of vegetable and fruit means to identify how it’s outer look like a circle,
ellipse and other shape. Different fruit has a different shape so there are easily classified on shape
based. The major features that are calculated to determine the shape of fruits and vegetable are
area, perimeter, major axis length and minor-axis length. Several research papers are studied to
know the procedure how can we calculated these features from an image. So reviews of those
papers that we studied and help to understand the procedure how shape features extracted from an
image.
2.2 Texture based recognition
Texture is defined as the roughness, coarseness and smoothness of an object. So different fruit has
different texture and this property is also useful in classification of fruit and other object. To
4. 4
calculate texture feature from an image first we have to calculate the Gray level co-occurrence
matrix (GLCM). Several research papers are studied to understand concepts for calculation of
GLCM and reviews of some of the paper are written that we study to complete the proposed work.
texture is vital property used in the identification of objects in an image and the image may be a
photomicrograph and satellite image. Textural features which are calculated using gray tone spatial
dependencies, and application in class recognition tasks of three kinds of image data: five
different kinds of sandstones photo are captured, aerial photographs 1:20 000 panchromatic of 8
land-use classes, and Earth Resources Technology Satellite multispecialty (ERTS) imagery having
seven land-use classes. Decision rules of two kinds are follows: rectangular parallelepipeds (a
max-min decision rule) are the one decision region and convex polyhedral (a linear decision rule
that is piecewise) are the one decision regions. In each testing the data were divided into two parts
are test and training set. 89 percent accuracy for the test set photomicrographs, 82 percent for
aerial photography and 83 percent for satellite images. These results show that the calculated
textural features are applicable for several image-classification applications. Graphics processing
units are inexpensive and higher computational capability required for hardware reconfiguration,
a much shorter development time and much faster than central processing unit. This paper
proposed a new, less powerful and cheaper graphic device (NVidia 8800GT) which is tested with
the Haralick Algorithm and it found that GPU is only 11 % slower than the device used earlier.
Amato et al., 2011 assessed correlations between texture determine as a function of segmentation
scale which can be used for mapping vegetation structure and range using 5-cm resolution true
color aerial photography. The least correlated as compared to other texture determines at all scales
are entropy, mean and correlations. Contrast and dissimilarity provide the maximum correlation
that maintains steady across all segmentation scale. It was observed that both decreasing and
increasing correlation coefficient for pairs of texture as segmentations scale augmented and was
largely changed from one scale to the next at linear segmentation and more reliable in correlation
at medium to coarse scale. This approach permitted for determining the most appropriate and
uncorrelated texture determine at the optimal image analysis scale for plotting vegetation structure
classes with sub-decimeter resolution imaginary. This technique can be applied in future to plot
individual species into rangeland observed protocols with high resolution images required.
Anami et al. 2010, observed the effect of foreign bodies in recognition and classification of bulk
food grains image samples using a Neural Network Approach. Any matter other than major food
grains are considered as a foreign body in this work, such as stones, soil lumps, plant leaves, pieces
5. 5
of stems, weed, other types of grains etc. Different food grains like, Green gram; Groundnut,
Jowar, Rice and Wheat are considered in the study. The color and texture features are presented to
the neural network for training and later of the unknown grain types mixed with foreign bodies.
The study reveals that the presence of even 10 percent of foreign bodies within food grain image
samples decreases its classification and recognition as low as 60%. When the foreign body is
higher than 50 percentages, it becomes complicated to classify and recognize food grain image
samples.
Anami et al.,2009 proposed a method in which texture feature was calculated from preprocessing
image on random windows. In research work, texture feature is given more importance and less
importance to the window selection and noise model. Get over this, Texture feature is calculated
after the image is preprocessed by considering various types of windows. Various methods are
applied for preprocessing on SW and RW. The RM has the same classification percentage on both
non preprocessed and preprocessed method in comparison to SW method. However preprocessing
takes more time but it gives better result for classification rate. The experiment performed on
different Broadatz textures and result obtained shows the better performance of the proposed
methods.
Arefi et al.,2011proposed a new image segmentation algorithm for green apple recognition based
on texture features and Maximum expectation (EM) algorithm for Gaussian mixture model
(GMM). Image capture represents RGB (Red, Green and BLUE) color space which is converted
into HSV (Hue, Saturation and Value). In the HSV color space H channel images were selected as
the interested image to be processed. Texture features are calculated using the image of the H
channel which is divided into blocks of 8*8 pixels. EM algorithm used Angular second moment
for clustering and prior probability, mean and variance were compute. GLCM (Gray level co-
occurrence matrixes) for every region was computed and texture features were calculated. Apples
were effectively recognized by the proposed segmentation methods and85.33% of apples were
successfully recognized.
Alftani et al., 2008 reviewed object descriptor tool for feature calculation has an application for
image cataloging and updating map. Multispectral imagery is generally used as input data and
limits of objects are defined by the cartographic database and the output table has the values of all
the features calculated for every object. Additional images and interpretive graph can be produced,
helpful for better analysis and understanding of object and features. The image can be used to
calculate a complete set of features which describe texture, structure and spectral attributes of the
6. 6
object. Structural features give knowledge about the spatial layout of various elements in the
evaluated object. The lists of features presented are tested in a real parcel-based sorting case, using
judgment tree added by means boosting methods. The results are presented the potential and
usefulness of the recommended features for geospatial and land cover or semi-automatic land use
database updating applications.
Amirulah et al., 2010, proposed a novel method which was highly accurate and retrieval efficient
approach on huge image database with changing background and contents. CBIR or content based
image retrieval techniques are used which means retrieval of image based on visual feature such
as color, texture and shape. Color feature extraction includes different color space like RGB (Red,
Green and Blue), HSV (hue, saturation and value) and HSB (hue, saturation and brightness) and
two types of color histogram are Global Color histogram (GCH) and Local color histogram
(LCH).Quasi-periodic patterns with spatial /frequency representation can be used to model
texture.Canny edge detection and shape invariant moment feature extraction. For calculation of
the similarity distance and Canberra distance is used Euclid functions. They used threshold
algorithm to display the image based on the value of the highest grade representation on each query
and compared the result of Feature extraction using the operator on fuzzy logic to generate
maximum value excess threshold algorithm compared with other methods lies in simplicity
retrieval method in the image so that performance of CBIR become more reliable and effective.
To form a texture, spectral information is the new class of texture to contribute and texture are
grouped in two databases. The first class of database is the Normalized Broad Texture (NBT) in
which gray images are collected and second, the Multiband texture in which color texture images
are collected. It is suggested that this new class of textures is added for accurate comparisons
between texture calculation methods which depend on the intrinsic performance on texture
description. Texture that is obtained from the combined effects of inter-band and intra-band spatial
variation introduced the idea of multiband texture. By the study a new database is proposed with
respect to the Multiband Texture (MBT) and image from this database have two important
properties are textural content and chromatic content. The classification result of the 8 textures
from the MBT database established that this data base can be used to develop intra-band and inter-
band texture based analysis method. The thirteen haralick’s texture information computed and
formulating a skin color classifier using stepwise linear discriminate analysis (LDA). The
performance of each skin color classifier was measured based on true and false positive value. The
result showed that the skin color classifier formulated with (RGB) CMCM at the direction (1,00)
7. 7
was most superior with respect to another direction. It’s true and false positive is 99.19 and 3.83
percentage respectively. The classifier formulated with (RGB) CMCM at the direction (1,900) was
totally failed to classify skin and non-skin colors. It was concluded that the texture feature which
are computed from (RGM) CMCM at (1,900) direction cannot represent skin and non-skin color
at all. Estimate and compared three different extraction methods for categorization of defect and
non-defect fruits of mosambi. Three feature calculation methods are GLCM (Gray level co-
occurrence matrix), intensity based features and shape features.PNN (Probabilistic Neural
Network) classifier was used to estimate and compares the performance of each feature extraction
method. By analysis these three techniques it is suggested that shape feature give best performance
as compared to GLCM (gray level co-occurrence matrix) and Intensity feature. The result proves
that shape feature based PNN is given higher classification rate of 100 %. The shape gives a better
result when compared with GLCM and intensity feature.
3. PROBLEM FORMULATION
Objectives
The objectives for the proposed work are as below.
1. To improve the Fruit recognition mechanism by using texture features derived from co-
occurrence matrix method and color features.
2. Simulation of knowledge-based cataloging mechanism using available classifiers in
MATLAB.
We classify the fruits based on varios feature such that color shape and varios textures that are
present in the images .after extracting the various features we classify them according to various
training sets that are created during the initial development stage.After extracting the features we
compare with the values that are present in the data base and then that values are tested and
classification process is done.
8. 8
4 METHODOLOGYFOR PROPOSEDCLASSIFICATION SYSTEM
Process for classification of fruits is described in the following figure-
Figure 4.1 process of classification
4.1 Process used to Capture Images
The most important step to start a development methodology is to capture the image of fruits. To
capture a fruit image a black box setup is created in which a constant light source is provided.
Arrangement of the black box is as follows box is totally black from inside and a two light source
is provided at the two sides of the box. For capturing images of fruits a digital camera (Nikon) is
used. Image of resolution 2592*1456 is captured. Image of five fruits captures in shown in figure.
9. 9
Figure 4.2 Images of various fruits
4.2. Image Preprocessing
Image of fruit is captured using a digital camera and then it is processed in MATLAB. Image
preprocessing is done because the captured image has lots of noise due to dust particle and light
condition. First the captured image is too big in size so the MATLAB show warning while
displaying it that image size is too large.
4.2.1 Image Resizes
A program is developed to resize an image without affecting the quality of the image. An image
is represented in the form of RGB pixels. Let us consider an image F(x, y) which is a two
dimensional function, where spatial coordinates are denoted by x and y. The amplitude of F at any
pair of coordinate is known as the gray level or intensity of the image at that particular point.
(a) (b)
Figure.4.2 (a) F(x,y) is an Image which is 3×3 pixel represented (b) F(3x,3y) is an Image
obtained by Scaling the Image F(x,y) by factor 3.
To understand the problem of ordinary image resize, F(x,y) is an original image which represents
3*3 pixel and have 9 pixel values is shown in figure 4.2 (a). When this image is scaled by a factor
3 then new image F(3x,3y) is formed which consist of 9*9 pixel and have 81 pixel values is shown
10. 10
in figure 4.2(b). F (3x, 3y) is a transformed image and is obtained by scaling the original image by
a factor of 3. The value in original image at (0,0),(0,1),(0,2),(0,3),(1,0) etc is represented in the
transformed image at the pixels value (0,0),(0,3),(0,6),(0.9),(3,0) and so on is show in figure 4.2
And by looking into the figure.4.2 (b) it is clearly visible that green circle represents the values of
pixels in the transformed image which is acquired from the original image but there are some pixel
in transformed image that do not have any value like (1,1), (2,1) and so on. These values in
transforming image are represented as black dots and don’t have any information. To obtain the
information on transforming image at these points, it should be inverse transformed and looking
the inverse scale value into the original image. For example, for obtaining the value at (1, 1) in
transforming image then it should be inverse scale by factor 1/3 and (1,1) is transformed into
(1/3,1/3). Original image is checked to find the value at (1/3, 1/3) which is inverse transformed,
but do not have any information because the image is digitized first by sampling and followed by
quantization. Sampling represents values at the discrete grid points and not consider the intensity
values at all possible value that are consider in continuous image. In the process of sampling
whatever the values of the location (1/3, 1/3) in the continuous image is lost. So in the digital
image at the particular location (1/3, 1/3) do not have any information and the only process to
obtain the value at that location is to approximate the intensity value. Approximation of intensity
value is done by the process called interpolation. Interpolation of the image is done after the
interpolation original image should have interpolated value at the location (1/3, 1/3) and this
particular value is used to fill the location (1,1) in the transformed image.
To achieve the interpolation it should satisfies the desired interpolation properties.
Finite region of support
Smooth interpolation and no discontinuity
Shift invariant
4.2.2 Feature Extraction
Image preprocessing is completed which include the image resize and remove noise from an
image. The image obtained after image preprocessing can be used for feature extraction. Feature
extraction plays a major role in classification of fruits. Feature that is extracted from fruits are
shape, color and texture. An algorithm is developed to extract all these features and compare their
result at the output.
11. 11
1. Shape feature extraction
2. Color feature extraction
3. Texture feature extraction
4. Edge detection
5. WORK DONE TILL NOW
The purposed approach described in the following
5.1 Smoothing of the image
First step is to smoothen the image. This is done by filtering out the noise from an image
before finding its edges. Gaussian smoothing using standard Guassian mask of size 3X3
pixel is done.
5.2 Thresholding
we need to fix some threshold value, the values of all the pixels are considered as zero. This
thresholding is needed because when LBP applied , the smaller values of pixels nearing to
zero interfere with the edge.In this work threshold value 30 is considered for the thresholding
process.
5.3 Local Binary Patterns
LBP (Local Binary Pattern) is applied to the preprocessed image.In LBP each pixel in 3X3
neighbourhoods is re- placed by calculated values. This process is repeated for all the
pixels of image Thresholding of LBP image pattern After LBP image is obtained, Direct
computation of the edges of LBP pattern image does not give satisfactory results. For this,
range of pixel value between high threshold value TH and lower threshold value TL is
selected. The pixel values which lie below TH and which lie above TL are set to zero.
After certain tests and comparison TH is taken as 2 and TL is taken as 254.
5.4 Adjusting various parameters
In this step various parameters like Gaussian filter mask, initial threshold value, TH , TL and
the Canny threshold value are adjusted accordingly to obtain the clear, continuous and sharp
edge. These parameters make the proposed approach flexible and increase the sensitivity of
the proposed approach
12. 12
REFERENCES
1. A. Gopal, R. S., Venkatesh. K. Srinivasan, Varsha N. K, Sumathi Poobal. 2012. classification of
color object like fruits using probability density function (PDF). IEEE journal: pp.1-4.
2. Abdelmounaime, S., Dong-Chen, H. 2013. New Brodatz-Based Image Databases for Grayscale
Color and Multiband Texture Analysis. ISRN Machine Vision.
3. Aibinu, A.M., Salami, M.J.E., Shafie, A.A., Hazali, N., Termidzi, N. 2011. Automatic fruits
identification system using hybrid technique. Electronic Design, Test and Application (DELTA),
2011 Sixth IEEE International Symposium on. IEEE. pp. 217-221
4. Alfatni, M. S. M., Shariff, A. R. M., Shafri, H. Z. M., Saaed, O. M. B., Eshanta, O. M. 2008.
Oil palm fruit bunch grading system using red, green and blue digital number. Journal of Applied
Sciences, 8(8): pp. 1444-1452.
5. Amato, D., Pablo, J., Garcia Bauza, C., Boroni, G. 2011. Color based fruits classification using
GPU. Latin America Transactions, IEEE , 9(3): pp. 346-350.
6. Amirulah, R., Mokji, M., Ibrahim, Z. 2010. Starfruit color maturity classification using Cr as
feature. Signal-Image Technology and Internet-Based Systems (SITIS), Sixth International
Conference on. IEEE. pp. 93-97.
7. Anami, B. S., Savakar, D. G. 2009. Improved method for identification and classification of
foreign bodies mixed food grains image samples. ICGST-AIML Journal, 9(1): pp. 1-8.
8. Anami, B.S., Suvarna, S.N., Govardhan, A. 2010. A combined color, texture and edge features
based approach for identification and classification of indian medicinal plants. International
Journal of Computer Applications, 6(12): pp. 45-51.
9. Arefi, A., Motlagh, A.M., Mollazade, K., Teimourlou, R.F. 2011. Recognition and localization
of ripen tomato based on machine vision. Australian Journal of Crop Science, 5(10): pp. 1144.