ISSN (Print) : 0974-6846 Indian Journal of Science and Technology, Vol 9(6), DOI: 10.17485/ijst/2016/v9i6/77739, February 2016 ISSN (Online) : 0974-5645 Implementation of RGB and Images in Plant Leaves Disease Detection – Comparative Study

K. Padmavathi1* and K. Thangadurai2 1Research and Development Centre, Bharathiar University, Coimbatore - 641046, Tamil Nadu, India; [email protected] 2PG and Research Department of Computer Science, Government Arts College (Autonomous), Karur - 639007, Tamil Nadu, India; [email protected]

Abstract Background/Objectives:

Digital image processing is used various fields for analyzing differentMethods/Statistical applications such as Analysis:­medical sciences, biological sciences. Various image types have been used to detect plant diseases. This work is ­analyzed and compared two types of images such as Grayscale, RGBResults/Finding: images and the comparative result is given. We examined and analyzed the Grayscale and RGB images using image techniques such as pre processing, ­segmentation, clustering for detecting leaves diseases, In detecting the infected leaves, color becomes an level.important Conclusion: feature to identify the disease intensity. We have considered Grayscale and RGB images and used median ­filter for image enhancement and segmentation for extraction of the diseased portion which are used to identify the ­disease RGB image has given better clarity and noise free image which is suitable for infected leaf detection than GrayscaleKeywords: image.

Comparison, Grayscale Images, Image Processing, Plant Leaves Disease Detection, RGB Images, Segmentation 1. Introduction 2. Grayscale Image: Grayscale image is a image or one-color image. It contains brightness Images are the most important data for analysation of information only and no color information. Then image processing applications. Various types of images grayscale data matrix values represent intensities. The are used for data analysiss The digital image I(r,c) is rep- typical image contains 8 bit/ allows the image to resented as a two dimensional array of data, where the ­represent (0-255) different brightness (gray) levels. data of each co-ordinate at point (r,c) corresponds to the 3. Indexed Image: An indexed image consists of an array brightness of the image at that point. and a colormap matrix. The pixel values in the array In digital image, a pixel is a smallest unit of image that are direct indices into a colormap. The colormap can be controlled and addressable by coordinates and the matrix is an m-by-3 array which is contained float- intensity of each pixel is variable. They are represented in ing-point values in the range [0,1]. Each row specifies a 2-D matrix. the red, green, and blue components of a single color. The Different types of digital images are: An indexed image uses direct mapping of pixel values to colormap values. 1. Binary Image: Binary image is the simplest type of 4. RGB Image: RGB image does not use a color map and image and has two values, or ‘0’ and an image is represented by three color component ‘1’. The binary image is referred to as a 1 bit/pixel image intensities such as red, green, and blue.RGB image because it takes only one binary digit to represent each uses 8-bit monochrome standard and has 24 bist/pixel pixel. where 8 bist for each color (red, green and blue).

*Author for correspondence Implementation of RGB and Grayscale Images in Plant Leaves Disease Detection – Comparative Study

2. Related Works 3.2 Image Pre-processing

Digital image processing is a technique which is used and 3.2.1 Image Filtering implemented in various areas of biology. It helps to identify Median filter is a nonlinear smoothing filter which is used and analyse the problem1. Plant leaves diseases detection to remove impulsive noise and reduce blurring of edges of and diagnostic method is a scientific method. The photo- plant diseased leaves. The median filter takes each pixel in graphic images are used to implement in the leaves disease the image and evaluates at its nearby neighbours to decide detection process. The photographic digital images are whether or not it is representatives of its surroundings. It is transferred into a particular form2. The Image pre-pro- replacing the pixel value with the median of neighbouring cessing is a method, used to transfer the original images pixel value; it replaces it with the median of those values. into another form. In plant leaves disease detection, cap- The pattern of neighbours is called “Window” which tured photographic images are used. There are noises in slides pixel by pixel over the whole image. The median the images, the regions of interest in the image is not clear is calculated by first sorting all the pixel values from the or other interference appears in the image3. The image pre- window and replacing the pixel being considered with the processing is used to get clear, noiseless enhanced leaves median pixel value. Median in a neighbour is not affected images. This enhanced images are used to leaves diseases by individual noise spikes. detection and analysation process. Various types of images are used in image pre-processing. The selection of image 3.2.2. Image segmentation type differs based on the processing area, implementation The proposed segmentation method uses enhanced of mathematical calculation and application. Generally, SRM using patches and labels. This evaluates the pixel plant leaves image color and texture are an unique features, values within a region and grouped together based on which are used to detect and analyse the diseases and their level3.This paper considers Grayscale and RGB images of infected plant leaf detection and analysation and gives the solution which is suited for the disease occurrence.

3. RGB Image Pre-Processing 3.1 RGB Image Representation

In the RGB model, each color represents the basic color Figure 2. Filtered image using Median Filter. components Red, Green, and Blue. RGB color images are represented in the RGB color model as red, green and blue using 8-bit monochrome standard. The correspond- ing RGB color image has 24 bit/pixel – 8 bit for each color band (red, green and blue). The RGB color represents to referring to arrow or column as a vector, it can be referred as a single pixel red, green and blue values as a color pixel vector -(R,G,B). The color space representation is:

Figure 3. Noise Removal using Red, Green and Blue Figure 1. RGB pixel representation. Channel.

2 Vol 9 (6) | February 2016 | www.indjst.org Indian Journal of Science and Technology K. Padmavathi and K. Thangadurai

using Density-based clustering approach, in a color image will be grouped into different clusters, and these clusters form the final segmented regions of the image.

4. Grayscale Image Pre- Processing 4.1 Grayscale Image Representation Figure 4. Mutiscale segmentation – RGB Image. Grayscale images are represented by intensity values. Grayscale images have many shades of gray in between black and white. The intensity of a pixel value is repre- sented within a given range between 0 and 1(minimum and maximum) and in between varying range shades of gray which ranges is between 0 and 255. The image pixels are stored in binary, quantized form.

4.2 RGB Image to Grayscale Image Conversion The captured diseased leaves image is in RGB image. Figure 5. Edge Detection of RGB Image. So it is necessary to convert from RGB to Grayscale for Grayscale Image pre-processing. This method matches the luminance of the grayscale image to the luminance the merging and produces results as a smaller list. This of the color image. First get the values of three primary is the process of segmentation based on color mapping colors (Red, Green and Blue) and encodes this linear and clustering (for patching and labeling). The plant intensity values using the gamma expansion. The gamma diseased leaf image is mapped and patched depending expansion is: on colors and the regions were labeled using clustering. Further, the segmented regions were separated by delet-  Crgb ing other regions which are identified by labels. Thus the  Crgb <= 0.04045  12.92 plant leaf image is processed by patching and labeling for Clinear =  (Crgb + 0.065) ­segmentation.  C> 0.04045  1.065 rgb Color Mapping: The proposed enhanced SRM is used for image segmentation under patching. The algorithm Here, C is RGB primaries which has the range from evaluates the pixel values within a region and grouped srgb 0 to 1 and C is the linear-intensity value which also together based on the merging criteria. The plant leaves linear has the range from 0 to 1. Then the luminance of the out- input image is applied for color mapping, depend on the put image is obtained using weighted sum of the three color it forms are grouped of pixels and replaces minor- linear intensity values. The conversion is obtained using ity colors by majority colors. Nine different levels of color the function: space threshold are applied as Q values for segmentation grouping of pixel, merging to form patches and color y = f(x) mapping. Here, x is the original input data and y is the converted Clustering: Clustering is a collection of similar values output data. The function f(x) converts RGB values to in matrix or similar colored maps. Using color mapping, grayscale values using weighted sum of the R, G, and B the mapped regions are grouped and forming a cluster components: which is called labelling. Depend on the segmented map regions or grouped regions the labels are occurred. By f(x) = 0.2989 ∗ R + 0.5870 ∗ G + 0.1140 ∗ B

Vol 9 (6) | February 2016 | www.indjst.org Indian Journal of Science and Technology 3 Implementation of RGB and Grayscale Images in Plant Leaves Disease Detection – Comparative Study

4.3.2 Image Segmentation The proposed Grayscale image segmentation also uses enhanced SRM using patches and labels. The result of the segmentation and clustering process is: (a) (b) Figure 6. (a) color image. (b) Grayscale image. 5. Experiment Results In plant leaf disease detection, we have taken two differ- ent types of images for processing and getting the results for both processes. RGB image pre-processing has given better results than Grayscale image pre-processing. The color of plant leaves is important for analysis. Because changed with the color is a major indicator of plant leaves diseases. This can be used and measured for diseases level easily. Figure 7. Filtered Grayscale image using Median Filter 6. Conclusion

In detecting the infection on leaves, Image Pre-processing is a reliable and efficient way to identify a disease condi- tion. It involves a collection of techniques that are used to improve the quality and visual appearance of an image. Plant leaves color and texture feature extraction are very important for disease analysis. This paper has considered and analysed two different types of images such as gray- scale and RGB color images. According to the experiments result, RGB image has given better results than Grayscale Figure 8. Mutiscale segmentation – Grayscale Image. image. RGB image has given clear, noise free image which is better suited for human or machine interpretation.

7. References

1. Arivazhagan S, Shebiah RN, Ananthi S, Varthini SV. Detection of unhealthy region of plant leaves and classifica- tion of plant leaf diseases using texture features. Agric Eng Int: CIGR Journal. 2013 Mar; 15(1):211–17. 2. Anami BS, Pujari JD, Yakkundimath R. Identification and classification of normal and affected agriculture/horticul- ture produce based on combined color and texture feature Figure 9. Edge Detection of Grayscale Image. extraction. International Journal of Computer Applications in Engineering Sciences. 2011 Sep; 1(3):356–60. ISSN: 2231-4946. 4.3 Image Pre-processing 3. Badnakhe MR, Deshmukh PR. An Application of 4.3.1 Image filtering K-Means Clustering and Artificial Intelligence in Pattern Recognition for Crop Diseases. International Conference Median Filter is used for removing the noise. This imple- on Advancements in Information Technology with work- mentation process is same as color image processing. The shop of ICBMG 2011, IPCSIT IACSIT Press, Singapore. result of this process is: 2011; 20:134–8.

4 Vol 9 (6) | February 2016 | www.indjst.org Indian Journal of Science and Technology K. Padmavathi and K. Thangadurai

4. Maini R, Aggarwal H. A Comprehensive Review of Image 18. Ghaiwat SN, Arora P. Detection and classification of plant Enhancement Techniques. Journal of Computing. 2010 leaf diseases using image processing techniques: A review. Mar; 2(3):8–13. ISSN 2157-9617. International Journal of Recent Advances in Engineering 5. Arunpriya C, Thanamani AS. Fuzzy inference system algo- and Technology (IJRAET). ISSN (Online): 2347–2812. rithm of plant classification for tea leaf recognition. Indian 2014; 2(3):1–7. Journal of Science and Technology. 2015 Apr; 8(s7):179–84. 19. Krishnan M, Sumitha MG. A novel algorithm for detect- 6. Mundhada SO, Shandilya VK. Spatial and transformation ing Bacterial Leaf Scorch (BLS) of shade trees using image domain techniques for image enhancement. International processing. Communications (MICC). 2013 IEEE Malasia Journal of Engineering Science and Innovative Technology. International Conference, IEEE Publication, kuala Lumpur. 2012 Nov; 1(2):213–16. 2013. p. 474–8. 7. Rajput S, Suralkar SR. Comparative Study of Image 20. Dhaygude SB, Kumbhar NP. Agriculture plant leaf disease Enhancement Techniques. International Journal of detection using image processing. International Journal Computer Science and Mobile Computing - A Monthly of Advanced Research in Electrical, Electronics and Journal of Computer Science and Information Technology. Instrumentation Engineering. 2013 Jan; 2(1):599–602. 2013 Jan; 2(1):11–21. ISSN 2320–088X – IJCSMC. 21. Narvekar PR, Kumbhar MM, Patil SN. Grape Leaf Diseases 8. Hwang H, Haddad R. Adaptive Median Filters: New Detection and Analysis using SGDM Matrix Method. Algorithms and Results. IEEE Trans Image Processing. International Journal of Innovative Research in Computer 1995; 4(4):499–502. and Communication Engineering. 2014 Mar; 2(3):3365–72. 9. Ananthi S, Varthini SV. Detection and Classification Of ISSN (Online): 2320-9801, ISSN (Print): 2320-9798. Plant Leaf Diseases. International Journal of Research in 22. Ren X, Malik J. Learning a classification model for segmen- Engineering and Applied Sciences. 2012; 2(2):868–74. tation. Proceedings of 9th IEEE ICCV, Nice, France, 2003 ISSN: 2249-3905. Oct; 1:10–7. 10. Sukassini. MP, Velmurugan T. A Survey on the Analysis 23. Felzenszwalb P, Huttenlocher D. Efficient graph-based image of Segmentation Techniques in Mammogram Images. segmentation. Int J Comput Vis. 2004; 59(2):167–81. Indian Journal of Science and Technology. 2015 Sep; 24. Grady L. Random walks for image segmentation. IEEE Trans 8(s22):IPL0259. Pattern Anal Mach Intell. 2006 Nov; 28(11):1768–83. 11. Bedi SS, Khandelwal R. Various image enhancement tech- 25. Sinop AK, Grady L. A seeded image segmentation frame- niques- A critical review. International Journal of Advanced work unifying graph cuts and random walks which yields a Research in Computer and Communication Engineering. new algorithm. Proceedings of IEEE ICCV, Rio de Janeiro. 2013 Mar; 2(3):1605–09. ISSN (Print): 2319-5940, ISSN 2007 Oct; 1–8. (Online): 2278-1021. 26. Yang W, Cai J, Zheng J, Luo J. User-friendly interactive 12. Singh H, Sodhi JS. Image Enhancement using Sharpen image segmentation through unified combinatorial user Filters. International Journal of Latest Trends in Engineering inputs. IEEE Trans Image Process. 2010; 19(9):2470–79. and Technology (IJLTET). 2013 Mar; 2(s2):84–94. 27. Xiang S, Pan C, Nie F, Zhang C. Turbo Pixel segmenta- 13. Zhang M, Meng Q, Zhang M. Citrus canker detection based tion using eigen-images. IEEE Trans. Image Process. 2010; on leaf images analysis. The 2nd International Conference 19(11):3024–34. on Information Science and Engineering, IEEE, Hangzhou. 28. Patz T, Preusser T. Segmentation of stochastic images with 2011; 3584–87. a stochastic random walker method. IEEE Trans Image 14. Patidar P, Srivastava S, Gupta M, Nagawat AK. Image de- Process. 2012 May; 21(5):2424–33. noising by various filters for different noise. International 29. Fulkerson B, Vedaldi A, Soatto S. Class segmentation Journal of Computer Applications. 2010 Nov; 9(4):45–50. and object localization with superpixel neighborhoods. (0975 – 8887). International Conference on Computer Vision (ICCV), 15. Grundland M, Dodgson NA. Decolorize, fast, con- Kyoto. 2009. p. 670–77. trast enhancing, color to grayscale conversion. 30. Yang Y, Hallman S, Ramanan D, Fawlkes C. Layered Object Computer Laboratory, University of Cambridge. 2007; Detection for Multi-Class Segmentation. In Computer 40(11):2891–96. Vision and Pattern Recognition (CVPR), San Francisco. 16. Kumar T, Verma K. A theory based on conversion of RGB 2010; 3113–20. image to gray image. International Journal of Computer 31. Ning J, Zhang L, Zhang D, Wu C. Interactive image seg- Applications. 2010 Sep; 7(2):7–10. (0975 – 8887). mentation by maximal similarity based region merging. 17. Bala R, Braun KM. Color to grayscale conversion to main- Elsevier, Pattern Recognition. 2010; 43(2):445–56. tain discriminability. Xerox Innovation Group, 800 Phillips 32. Tang J. A color image segmentation algorithm based on Rd, 128-27E, Webster, NY 14580. 2003. region growing. 2010 2nd International Conference on

Vol 9 (6) | February 2016 | www.indjst.org Indian Journal of Science and Technology 5 Implementation of RGB and Grayscale Images in Plant Leaves Disease Detection – Comparative Study

Computer Engineering and Technology (ICCET), Chengdu. 38. Hirakawa S, Nagao T. Evolutionary image segmentation based 2010; 6:V6-634–637. on multiobjective clustering. 2009 CEC ‘09 IEEE Congress on 33. Varshney S, Rajpal S, Purwar N R. Comparitive study of Evolutionary Computation, Trondheim. 2009 May; 2466–73. image segmentation techniques and object matching using 39. Gonzalez RC, Woods RE, Eddins SL. Digital Image segmentation. Methods and Models in Computer Science, Processing using MATLAB. Second edition, Pearson Delhi. 2009; 1–6. Education, 2007. 34. Wang Z, Yang M. A fast clustering algorithm in image 40. Pratt W K. Digital Image Processing. Fourth Edition, A segmentation. Computer Engineering and Technology John Wiley & Sons Inc. Publication, 2007. (ICCET). Chengdu. 2010; 592–94. 41. Kalechman M. Practical MATLAB-Basics for Engineers. 35. Chen Q, Xue B, Sun Q, Xia. Interactive image segmenta- Special Indian Edition, CRC Press, 2008. tion based on object contour feature image. 2010 17th IEEE 42. Ghosh SK. Digital Image Processing. Narosa Publishing International Conference on Image Processing (ICIP), House Pvt. Ltd, 2013. Hong Kong. 2010 Sep. p. 3605–08. 43. Gonzalez RC, Woods RE. Digital Image Processing. Second 36. Xia Y, Feng D. A General Image Segmentation Model and its Edition, Prentice-Hall, 2002. Application. 2009 ICIG ‘09 Fifth International Conference 44. Sangwin S, Horne R. The Color Image Processing on Image and Graphics, Xi’an Shanxi. 2009 Sep. p. 227–31. Handbook. Chapman & Hall, 1998. 37. Shirakawa S, Nagao T. Evolutionary image segmenta- 45. Jayaraman S, Esakkirajan S, Veerakumar T. Digital Image tion based on multiobjective clustering. Evolutionary Processing. Tata McGraw Hill Education Pvt. Ltd, 2012. Computation, 2009. CEC ‘09. IEEE Congress on Trondheim. 46. Felzenszwalb PF, Huttenlocher DP. Efficient Graph Based 2009 May. p. 2466–73. Image Segmentation. 2004; 59(2):167–81.

6 Vol 9 (6) | February 2016 | www.indjst.org Indian Journal of Science and Technology