You are on page 1of 9

2015 IEEE International Conference on Technological Innovations in ICT for Agriculture and Rural Development (TIAR 2015)

Automated Color Prediction of Paddy Crop Leaf


using Image Processing
Amandeep Singh Maninder Lal Singh
Department of Electronics Technology, Department of Electronics Technology,
Guru Nanak Dev University Guru Nanak Dev University
Amritsar, India Amritsar, India
amandeep.singh.sodha@gmail.com mlsingh7@gmail.com

Abstract-In India a majority of the population in rural areas is the automatic prediction of plant leaf color by its comparison
working in the agriculture field for their livelihood. They not only with LCC. After knowing the color shade of the plant, this
have to struggle for the better yield against the natural disasters algorithm can be programmed to give the suggestions regarding
but also have to tackle the losses of the net output because of land the health status of plant and hence crop.
fertilization specifications and unskilled labour too. In the event of
inadequate utilities and resources, in the face of unpredictable II. LITERATURE REVIEW
crises, their gain opportunities and livelihood are proportionally
and adversely affected. However in this era of technology, the A lot of work has been done in the field of agriculture by
scenario may get changed as the Information and Communication the researchers to facilitate the farmers.
and related fields of technology are providing a great for such type Savita N. Ghaiwat and Parul Arora has beautifully
of crisis handling. Here in this paper, the method which may be
summarized the techniques used for plant disease detections by
used to compare the crop leaf color with the leaf color chart (LCC),
has been proposed for getting a detail about the requirement of various researchers such as BP Neural network based, Support
plant, before enough to get the yield affected. By making use of vector based Machine based, K- Mean clustering based and
image processing technology a simple and robust method for the many more[1]. Android platform base application has been
color prediction of paddy crop plant has been discussed along with developed by Van Joshua L. Abergos, Philip Zesar Boreta etal.,
the mathematical modelling which may provide a great platform to for the automatic prediction of nitrogen content of paddy plant.
the advisory bodies in the agriculture field for the atomization of The application was developed using bitwise operations and
the crop health problems and solutions. results were authenticated via Z-Test approximations showing
an average accuracy of 80% [2].
Keywords: Leaf Color Chart (LCC), Hue, Histogram, Correlation
Image processing based automatic counting of rice plant
coefficient hoppers was done by Yao Qing, Ding-xiang, etal. in 2014 based
on the Haar Feature Extraction of plant [3]. Hiteshwari Sibrol
I. INTRODUCTION
and Satish Kumar has presented their review work, based on K-
means clustering and thresholding for wheat disease detection
There are a lot of plant diseases which are found to be
[4].
present in the crop fields because of the land fertilizer and
Other than the agriculture based research, the work has also
mineral specifications, environmental conditions and many
been brought to new heights in the field of image processing for
more miscellaneous factors. The most of these diseases are
application oriented programmes.
because of malnutrition and can be tackled by taking care of
Sion Hannuna1 , N. Anantrasirichai etal. has shown
above mentioned parameters. For instance in case of paddy crop
their earnings in this area of application of image processing by
which is the one of major agriculture grain being produced and
designing an agriculture disease mitigation system. A lot of
consumed in India, the health of the plant and ultimately the
work starting from the image acquisition, computer vision
grain quality are dependent on various minerals like urea,
system, color correction, illumination standardization and then
nitrogen, phosphorous, potassium etc. Because of the inadequate
proceeding with transformation matrices has been concluded
amounts of such types of the minerals and fertilizers, the crop
with the calculation of EMD for various image acquisition
plant health gets adversely affected and results in the change of
devices [5].
the leaf color of plant. An important tool for the prediction of
Other than above a very brief but impressive summary
color corresponding to good plant health is leaf color chart
about DIP techniques used for detection, quantification and
(LCC), provided by various agriculture advisory bodies. The
classification has been published by Jayme Gracia Arnal
LCC consists of the various shades of green varying from the
Barbedo [6]. The author has covered many technological
light green towards dark green, telling about the health status at
parameters like dual segmented regression analysis, neural
different ages of plant. However till date there is no such a
networks, and color analysis. Fuzzy logic, discrimination
method has been developed to characterize the plant leaf color
analysis etc. concluding that image processing techniques can
to predict the health of the plant automatically by its comparison
provide enough potential solution to the problems to be missed.
with the LCC. This paper aims the same target proposing an
Sindhuja Sankaran, Ashish Mishra, Reza Ehsani and Cristina
algorithm which has been developed on MATLAB platform for
Davis has also done a very nice review of advanced techniques

978-1-4799-7758-1/15/$31.00 2015 IEEE 24


2015 IEEE International Conference on Technological Innovations in ICT for Agriculture and Rural Development (TIAR 2015)
for detecting plant diseases [7]. A hyper spectral image based was collected from the paddy fields, on weekly basis throughout
technique, for early detection of rice blast (Pyricularia) at the crop season. This data has not only been used for the current
seedling stage in Nipponbare rice variety has been proposed by research but can also be used in the achievements of future
Yan Yang, Rongyao Chai and Yong He. A wavelength based research goals. Second major problem of LCC was solved by the
analysis has been provided representing spectral characteristic utility of LCC and Crop Fertilizer Information [13] provided by
of seedlings [8]. Other than the above the research is going on Punjab Agriculture University (PAU Ldh.) to the farmers.
by various individuals in the field, based on various techniques However the LCC used for this research purpose has been
such as digital morphometrices [9], Affine Transformations designed in MATLAB in accordance with the information
Edge Detection and Pixel Comparison [10], gradient based provided in the brochure [13]. Here initializing from position 1
features [11], Fractel Dimension Analysis [12]. to 6, the shades are named as: 1) Lightest Green 2) Lighter Green
3) Average Green 4) Dark Green 5) Darker Green 6) Darkest
Green respectively. The same has been shown in Fig. 2.
III. METHODOLOGY AND DATA COLLECTION
The next step was to get the test image data in true color
The research has been carried out using the real time images format so that it can be processed with maximum accuracy. Now
of paddy plants and a MATLAB generated leaf color chart. The as the image acquisition devices capture the image in RGB
LCC was designed in such a way that the all shades of green format, which is not same as the phenomenon of retina of human
could lie in the range. By following a well-mannered eye. So if the processing is done in RGB mode, its results may
methodology the objectives of the research were achieved. differ from the actual ones, raising the validation problems. A
Following flow chart provides a brief about the flow of research: solution to this is that convert the test image to the HSI (Hue,
Saturation, Intensity or Value) color space [14]. Fig. 3 explains
STAR all the information in visual form.
T As hue changes from 0 to 100%, the corresponding
Get the Images to be analysed colors also vary from red via yellow, green, cyan, blue, magenta
and again back to red, so that there are actually red values both
at 0 and 100%. As saturation is varied from 0 to 100%, the
Color Yes corresponding colors (hue) vary from unsaturated (shades of
Convert to HSV
space gray) to fully saturated (no white component). As value or
color Space brightness/Intensity, varies from 0 to 100%, the corresponding
conversion
required..? colors become increasingly brighter.
N
Get the image part to be processed
o

Image Morphological Masking


compressio Operations and ROI
n/Cropping
Selection

Generation of database (LCC)


Fig. 2. Leaf Color Chart

Compare the test image with database

Compare Test data with the database


Found Best
Match..? N
Yes o

Accuracy Calculation & Result


Authentication
Stop
Fig. 3. Illustration of HSI color space
Fig. 1. Overview of methodology adopted
The conversion of RGB to HSI color space has been
After getting started, the very first step is to get the done as follows [14]:
information to be processed (The test images) and the
information to be used as reference (The LCC). So a lot of data

25
2015 IEEE International Conference on Technological Innovations in ICT for Agriculture and Rural Development (TIAR 2015)

={ (1)
360 >
1/2[()+()]
With = cos 1 {(_________________________________
2 1/2
) (2)
[(_) +()()]

The Saturation component is given by:


3
= [1 (++)] [min(, , )] (3)

Finally the Intensity/Value component can be calculated as: Fig. 5. Compressed Image with loss of color information

1
= 3 ( + + ) (4) Test Image in RGB Conversion to
format binary Image
For the above mentioned conversions it has been assumed that
RGB values has been normalized between 0 to 1 and the angle
theta is measured with respect to the red axis of HSI color space.
Hue value can be normalized to [0, 1] by dividing all values by Coordinate
360o from the equation (1). The other two components will Inversion of binary image
Localization for
already be in the range if RGB values are already normalized to and size calculation
non zero Pixels
[0, 1].
Image compressions, morphological operations and
masking etc. are the secondary steps to be done for getting a
Logical Mapping of
precise and quick response. To make the compatibility of Cropping from Non RGB Image onto 2D
MATLAB compilers, only the portion of the image was selected Zero Coordinates Image
which contains the leaf. This proven to be a very adequate step
towards the overall performance of the algorithm. However the
popular, lossy compression techniques (Such as JPEG
compression) were not used because compression comes at a
cost, reducing the color information which cant be Rejecting Zero Getting RGB data
compromised as it leads to imprecise results. For instance, the valued pixels from from mapped image
result of compression on a single test image has been shown Image
which clearly led to the rejection of compression of data.
After neglecting the idea of compression, the next
Fig. 6. Block Diagram for Cropping Mechanism
method for the image data collection was cropping. As the
cropping can be done manually but for the automation of data selection a hybrid model of cropping (using 2D masking and
then shifting to the cropping of RGB/HSI image) was used
which produced very satisfactory results. Block diagram for this
logical and conditional programming based model has been
shown in Fig. 6.
Final step was to get rid of noise, before feeding the test
image to the algorithm. In MATLAB platform for the said
purpose there are mainly three commands used for
morphological operations are available which are summarized
as [15]:
Fig. 4. Uncompressed Image 1. bwareaopen(im1,4)
It fills the open areas whose size is less than four
pixels. It uses a brush of four pixels (which is user
defined).
2. imopen(imname,strel('disk',2))
It uses a brush of size 2 pixels (User defined) for
filling up the areas which are open at any end.
3. imfill(imname,'holes')

26
2015 IEEE International Conference on Technological Innovations in ICT for Agriculture and Rural Development (TIAR 2015)
This fills white holes in a given image (Here in this
syntax imname is the variable carrying image
information).

IV. DATA ANALYSIS


The basic approach for data analysis is the histogram
calculation and interpretation. A histogram gives a graphical
representation of color value and the number of pixels
corresponding to a particular color value. This fact has been used
as the backbone of the research and the histograms of Hue
component of reference data (Six shades of LCC) and test data
are calculated. The histograms of Red, Green and Blue
components and Saturation and Intensity components has also
been calculated. But as the information producing accurate
results lie in the Hue component only as the brain and human
retina respond to hue of scene, so the decisions are based and
limited up to the analysis of Hue histograms only. Fig. 9. Inverted Binary Noise free Image

Before getting to the histograms and final results, here


are the previous data which has been deducted from the original
data images. Starting from the unprocessed original image to the
final image and its various component images are shown below
in a sequential manner:
Fig. 10. Mapped & Cropped Test Image in RGB Color Space

Fig. 11. Test Image in HSI Color Space (Ready to be processed)

Fig. 12. Hue Component of Test Image


Fig. 7. Original Unprocessed Image

Fig. 13. Saturation Component of Test Image

Fig. 8. Binary Image (Noisy)


Fig. 14. Intensity Component of Test Image

27
2015 IEEE International Conference on Technological Innovations in ICT for Agriculture and Rural Development (TIAR 2015)
the shade Lighter Green has maximum pixel count, declaring
that the test image has best match with Lighter Green shade of
LCC.
If in case test image hue value comes out to be, for
example 51, then there will not be any exact match with the LCC
hue values where there is the maxima. This ambiguity has been
resolved by making the assumption that the nearest value of the
Hue will be having the best match. That is:
Best Matching Hue Value = min[|HT-Hi|] , 1 i 6 (5)
Where HT Hue value of Test image with maximum count of
pixels.
HiHue values of LCC shades (One to Six) with
maximum count of pixels.
Next and final step is the validation of the results obtained and
hence accuracy. For this sake the correlation between the two
Fig. 15. Histogram of Hue Component of Test Image
sequences of histograms has been calculated as it is one of the
Here in the above plot, along the x-axis, only that portion of Hue most familiar measures of relations between two random
values has been shown which has non zero count values (That sequences. It can obtained by dividing the covariance the two
variables by the product of their standard deviations as below:

(,) [( )( )]
Corr(x,y) = = (6)

When the analysis has to be done on a series of n measurements


of X and Y written as xi and yi where i =1, 2, 3, 4, ..., n, then
the sample correlation coefficient can be used to estimate the
correlation r between X and Y. The sample correlation
coefficient has been calculated as:

(7)

Fig. 16. Histogram of Hue Component of LCC (All Shades)


Where x and y are the mean values corresponding to X and Y,
is the portion where the maximum hue information lies). The sx and sy are the sample standard deviations of X and Y. Thus
remaining axis count from 0-20 and 90-255 has been skipped. equation (7) can be written as:

In the same manner the histograms of LCC shades has


been calculated and plotted as shown in Fig. 16.

(8)
V. DECISION MAKING AND
Following the above statistical approach the correlation between
AUTHENTICATION
the observed histogram and the LCC histograms has been
calculated respectively, which are presented and discussed in the
The main observation here to make is that the
maximum number of pixel count (other than zero hue value, following section.
which corresponds to black background in the test image being
processed) is maximum at Hue value 53 and is a unique number.
On the other hand when same observation was made for LCC
histogram plot, it was found that corresponding to 53 Hue value,
VI. RESULTS AND DISCUSSION

28
2015 IEEE International Conference on Technological Innovations in ICT for Agriculture and Rural Development (TIAR 2015)
The developed algorithm was tested over a range of test Ei Expected value of the histogram sequence
images, belonging to different shades of LCC. The algorithm has
produced very impressive results as given on the next page. The test returns a test decision for the null hypothesis
When the correlation between the two histogram data was that the data in vector or matrix being tested comes from a
calculated, the peak value observed was to be treated as the best certain distribution with a mean and variance estimated from that
match value and algorithmic results were found to be exact the variable. The alternative hypothesis is that the data does not
same in all cases. come from such a distribution. The parametric value is 1 if the
test rejects the null hypothesis at the 5% (or may be user defined)
Other than the correlation statistics, one more test Chi
significance level, and is zero otherwise, when the hypothesis is
Square Goodness of Fit was done, whose parametric result
accepted.
corresponding to the null hypothesis should be equal to zero. The
test statistic value, is a chi-square random variable (2) defined
by the following equation. A complete result table for different inputs along with
the parameters for various statistics has been given accompanied
by the percentage efficiency of the algorithm.
2 = [ (Oi - Ei)2 / Ei ] (9)

Where Oi Observed value of the histogram sequence

TABLE I. COMPLETE RESULTS

S. Test Image* Correlation Value of Test Image Histogram Chi Square Whether the Best Accuracy
No. with all Histograms of LCC Goodness of Null Matching
Fit Test hypothesis Shade Given
[h value has been by
calculated in accepted or Algorithm
MATLAB] rejected

Color of LCC Correlation Value


with Test Image
1. Lightest Green 0.2285 H=0 Accepted Lighter Green 100%
Lighter Green 0.4779
Average Green -0.0142

Dark Green -0.0170

Darker Green -0.0176


Darkest Green -0.0169

2. Lightest Green 0.1195 H=0 Accepted Lightest 100%


Green
Lighter Green 0.0256
Average Green -0.0129

Dark Green -0.0130


Darker Green -0.0134
Darkest Green -0.0129
3. Lightest Green -0.0116 H=0 Accepted Darkest 100%
Green
Lighter Green -0.0116

Average Green -0.0092


Dark Green -0.0088
Darker Green -0.0073
Darkest Green -0.0057

4. Lightest Green -0.0092 H=0 Accepted 100%

29
2015 IEEE International Conference on Technological Innovations in ICT for Agriculture and Rural Development (TIAR 2015)
Lighter Green 0.0188 Average
Green
Average Green 0.4640
Dark Green -0.0132
Darker Green -0.0151
Darkest Green -0.0144

5. Lightest Green -0.0090 H=0 Accepted Darker Green 100%


Lighter Green -0.0090

Average Green -0.0088

Dark Green 0.0083

Darker Green 0.3562


Darkest Green 0.1773
6. Lightest Green -0.0115 H=0 Accepted Dark Green 100%
Lighter Green -0.0114

Average Green -0.0091


Dark Green -0.0086
Darker Green -0.0072

Darkest Green -0.0058


Overall no. of Samples Tested: 06 Mathematically True & Tested: 06 Overall Accuracy of Algorithm: 100%

Test Image*: All the data has been captured in normal day light (Uncontrolled Illumination Conditions). In this concern the
thresholding has been done at different values varying from 40 to 50, used while cropping of test image. However with controlled
illumination it can be avoided.
Fig. 18. Final plot of Histograms for Test Image 2

Fig. 17. Final plot of Histograms for Test Image 1

Fig. 19. Final plot of Histograms for Test Image 3

In the above figure, it is very clearly observed that


there is a large difference between the two values of hue for the
test image and the matching one from LCC. The assumption
made in this case is that I the maximum hue color value can be
88. All the values lying above this will be treated as a part of
the darkest shade of green in the LCC. However the constraints
can be imposed on the illumination conditions, thresholding
values and hence the Hue of the test image to be in a limited
proportion of concerned shade of LCC. Other than it saturation
and intensity values of image can, too, deviate the output from
the actual one if not handled properly.

30
2015 IEEE International Conference on Technological Innovations in ICT for Agriculture and Rural Development (TIAR 2015)
fixed. However the solution to this is variable user defined
thresholding and making necessary adjustments to the shades
of LCC. A more convenient and appropriate solution to it has
been discussed in next section.

VIII. CONCLUSION AND FUTURE WORK

In this paper a new algorithm has been proposed and


implemented for detection of color of paddy crop plant in
reference with leaf color chart (LCC), before enough to get rid
of any crop disease. At a glance results shows that

A simplified, accurate and robust technique.


Working on real time environmental conditions.
Fig. 20. Final plot of Histograms for Test Image 4 Correlation parameters calculation verifying the
accuracy.
A novel approach in the field of agriculture for paddy
crop.
Checking about future aspects, after verification of the
result in different environment conditions, it can be
implemented in real time live projects and can be made
adaptable/hybrid model with genetic algorithms or neuro-fuzzy
optimization techniques. Woking on controlled illumination
conditions and getting results in lab environment and detection
of disease based on color and pattern, is in progress.

ACKNOWLEDGMENT
This work is supported by Electronics and Communication
Department of Guru Nanak Dev University, Amritsar, Punjab,
Fig. 21. Final plot of Histograms for Test Image 5 by providing excellent laboratories (Computer Lab) and
MATLAB software for the development and testing of the
algorithm.

REFERENCES
[1] Savita N. Ghaiwat, 2Parul Arora, Detection and Classification of Plant
Leaf Diseases Using Image processing Techniques: A Review,
International Journal of Recent Advances in Engineering & Technology
(IJRAET), ISSN (Online): 2347 - 2812, Volume-2, Issue - 3, 2014.
[2] Van Joshua L. Abergos, Philip Zesar Boreta etal, .Android-Based Image
Processing Application for Rice Nitrogen Management, A Thesis Report
Ateneo de Naga University, March 2012.
[3] YAo Qing1, XIAN Ding-xiang1, etal., Automatic Counting of Rice
Planthoppers in Paddy Fields based on Image processing, Journal of
Integrative Agriculture, Advance Online Publication, Doi
10.1016/S2095-3119(14)60799-1, 2014.
[4] Hiteshwari Sabrol, Satish Kumar, An Identification of Wheat Rust
Diseases in Digital Images:A Review, International Journal of Computer
Science Engineering and Information Technology Research
(Ijcseitr),ISSN 2249-6831 Vol. 3, Issue 3, PP85-94, 2013.
[5] Sion Hannuna1, N. Anantrasirichai Etal., Agriculture Disease Mitigation
System, Ictact Journal On Communication Technology: Special Issue On
Next Generation Wireless Networks And Applications, Volume 2, Issue
2, ISSN: 2229-6948,June 2011.
Fig. 22. Final plot of Histograms for Test Image 6 [6] Jayme Garcia Arnal Barbedo, Digital Image Processing Techniques For
VII. CHALLENGES Detecting, Quantifying And Classifying Plant Diseases, Barbedo
Springerplus 2013.
[7] Sindhuja Sankarana, Ashish Mishraa, Reza Ehsania,, Cristina Davis, A
The most significant challenge faced during the work Review of Advanced Techniques For Detecting Plant Diseases,
was capturing the quality images with maximum detail of the Computers and Electronics in Agriculture 72 (2010) 113
www.elsevier.com/Locate/Compag
leaf color. It is very typical task to get the image with all the [8] Yan Yang, Rongyao Chai, Yong He, Early Detection of Rice Blast
details within a processable memory. Such images are formed (Pyricularia) At Seedling Stage in Nipponbare Rice Variety Using Near-
a through high resolution and thus are of 6-10MB of size. This Infrared Hyper-Spectral Image, African Journal Of Biotechnology Vol.
was handled by using a Nikon made D5200 camera which 11(26), PP. 6809-6817, 29 March, 2012, Doi: 10.5897/Ajb11.3269 ISSN
16845315,2012.
served the task very well. [9] James S. Cope A, David Corney B, Plant Species Identification using
Second challenge faced was to get rid of illumination Digital Morphometrics: A Review, Expert Systems With Applications 39
conditions as from the start to the end of paddy crop season, (2012) 75627573.
illumination varies a lot even when the image acquiring time is
31
2015 IEEE International Conference on Technological Innovations in ICT for Agriculture and Rural Development (TIAR 2015)
[10] Ramanjeet Kaura, Salam Dina and PPS Pannu b , Expert System to
Detect And Diagnose the Leaf Diseases of Cereals, International Journal
of Current Engineering and Technology, ISSN 2277 4106, 2013
(Inpressco)
[11] Kanesh Venugoban, Amirthalingam Ramanan, Image Classification of
Paddy Field Insect Pests Using Gradient-Based Features, International
Journal of Machine Learning and Computing, Vol. 4, No. 1, Doi:
10.7763/Ijmlc.20, February 2014.
[12] Dr. Mia Torres-Dela Cruz, Murugananthan Velayutham Etal., Chaos
Game and Fractal Dimension in Image Processing to Detect Rice Leaf
Blast Disease, International Symposium On Mathematical Sciences and
Computing Research(iSMSC 2013), Perak, Malaysia. Paper Id.: Mt_14,
2013.
[13] Dr. Jagdev Singh Kular, Package of Practices for Kharif Crops of Punjab,
Punjab Agriculture University Ludhiana, 2014.
[14] Rafael C. Gonzalez, Richard E. Woods , Digital Image Processing Second
Edition, Prentice Hall, Upper Saddle River, New Jersey 07458
[15] Amandeep Singh, Jaspreet Kaur, Driver Fatigue Detection using Machine
Vision Approach, 3rd IEEE International Advance Computing
Conference (IACC) 978-1-4673-4529-3/12/2012, 2013
[16] Ganesh Naik R., Gangadhara Naik B., Etal., Fungicidal Management of
Leaf Blast Disease in Rice, Global Journal of Bio Science and
Biotechnology,Vol.1 (1): 18-21 ISSN 2278 9103, 2012.
[17] Aleixos, N., Blasco, J., Navarrn, F., Molt, E., 2002. Multispectral
Inspection of Citrus in Real-Time Using Machine Vision and Digital Signal
Processors. Computers and Electronics in Agriculture 33 (2), 121137.
[18] Sirisomboon, P., Hashimoto, Y., Tanaka, M., A Study on Non-Destructive
Evaluation Methods For Defect Pods For Green Soybean Processing by
Near-Infrared Spectroscopy. Journal of Food Engineering 93, 502512.
[19] Spinelli, F., Noferini, M., Costa, G., Near Infrared Spectroscopy (Nirs):
Perspective of Fire Blight Detection in Asymptomatic Plant Material,
Proceeding of 10th International Workshop on Fire Blight. Acta
Horticulture 704, 8790.

32