Crop Monitoring System Using Image Processing and Environmental Data
Total Page:16
File Type:pdf, Size:1020Kb
Crop Monitoring System Using Image Processing and Environmental Data Shadman Rabbi - 18341015 Ahnaf Shabik - 13201013 Supervised by: Dr. Md. Ashraful Alam Department of Computer Science and Engineering BRAC University Declaration We, hereby declare that this thesis is based on the results found by ourselves. Materials of work found by other researcher are mentioned by reference. This thesis, neither in whole or in part, has been previously submitted for any degree. ______________________ Signature of Supervisor (Dr. Md. Ashraful Alam) ___________________ Signature of Author (Shadman Rabbi) ___________________ Signature of Author (Ahnaf Shabik) i Acknowledgement Firstly we would like to thank the almighty for enabling us to initiate our research, to put our best efforts and successfully conclude it. Secondly, we offer our genuine and heartiest appreciation to our regarded Supervisor Dr. Md. Ashraful Alam for his contribution, direction and support in leading the research and preparation of the report. His involvement, inclusion and supervision have inspired us and acted as a huge incentive all through our research. Last but not the least, we are grateful to the resources, seniors, companions who have been indirectly but actively helpful with the research. Especially Monirul Islam Pavel, Ekhwan Islam, Touhidul Islam and Tahmidul Haq has propelled and motivated us through this journey. We would also like to acknowledge the help we got from various assets over the internet; particularly from fellow researchers’ work. ii Table of Contents Declaration .................................................................................................................................... i Acknowledgement ........................................................................................................................ ii List of Figures................................................................................................................................ v Abstract ......................................................................................................................................... 1 Chapter 1: Introduction 1.1 Motivation .......................................................................................................................... 2 1.2 Literature Review ............................................................................................................... 3 1.3 Thesis Orientation............................................................................................................... 5 Chapter 2: Elaborations of Algorithms and List of Sensors 2.1 Algorithms ........................................................................................................................ 6 2.1.1 Canny Edge Detector Algorithm ........................................................................... 6 2.1.2 Euclidean Distance Metric Algorithm ................................................................... 8 2.1.3 K-means Cluster Image Colour Segmentation ...................................................... 9 2.1.4 L*A*B* Colour Segmentation............................................................................. 12 2.1.5 Support Vector Machine (SVM) .......................................................................... 14 2.1.6 Greyscale .............................................................................................................. 17 2.2 Sensor Details .................................................................................................................... 19 2.2.1Gas Sensors .............................................................................................................. 19 2.2.2 Light Sensors ......................................................................................................... 22 2.2.3 Soil Sensors ............................................................................................................ 24 2.2.4 Justification ............................................................................................................ 25 iii Chapter 3: Proposed Methods 3.1 Real-Time Data Sensing .................................................................................................... 27 3.1.1 Gas Detection ....................................................................................................... 27 3.1.2 Light...................................................................................................................... 27 3.1.3 Air Quality............................................................................................................ 28 3.1.4 Soil Quality........................................................................................................... 28 3.2 Colour Segmentation Based .............................................................................................. 29 3.3 Leaf Diseases Detection and Classification ...................................................................... 30 3.3.1 Dataset Pre-Processing ......................................................................................... 30 3.3.2 Extracting the Affected Regions .......................................................................... 30 3.3.3 Leaf Diseases Classification Using SVM ............................................................ 31 Chapter 4: Result and Analysis ................................................................................................ 33 Chapter 5: Conclusion and Future Work 5.1 Conclusion .......................................................................................................................... 39 5.2 Future Work ....................................................................................................................... 39 References ................................................................................................................................... 40 iv List of Figures Figure 2.1 Different Cluster Analysis ......................................................................................... 11 Figure2.2Colour Segmentation using L*A*B*........................................................................... 13 Figure2.3 A Training Example of SVM….................................................................................. 15 Figure2.4 Removing Noise with Morphological Operations like Image Opening ..................... 18 Figure2.5 MQ135 (Carbon dioxide) ........................................................................................... 20 Figure2.6 MQ7 (Carbon monoxide) ........................................................................................... 20 Figure2.7 MQ8 (Hydrogen) ........................................................................................................ 21 Figure2.8 Grove-ME2 (Oxygen) ................................................................................................. 21 Figure2.9 Gravity Analog UV sensor V2 (Ultraviolet) .............................................................. 22 Figure2.10Analog Ambient Light Sensor.................................................................................... 22 Figure2.11 Light Dependant Resistor.......................................................................................... 23 Figure2.12 Moisture and Temperature Sensor (DHT22) ............................................................ 23 Figure2.13 Soil Temperature Sensor (DS18B20) ....................................................................... 24 Figure2.14 Soil Moisture Sensor ................................................................................................ 24 Figure3.1Block diagram of Proposed Methods .......................................................................... 26 Figure3.2Aerial Image Segmentation ......................................................................................... 29 Figure3.3 Leaf Diseases detection .............................................................................................. 31 Figure4.1 Obtain Oxygen ppm values ........................................................................................ 33 Figure4.2 Obtain Carbon Dioxide ppm values ........................................................................... 34 Figure4.3 Obtain Carbon Monoxide ppm values ........................................................................ 34 Figure4.4 Aerial Image Segmentation ........................................................................................ 35 Figure 4.5 Different types of plants with different diseases and detection accuracy .................. 37 v Abstract We propose advanced crop monitoring system using image processing from environmental data for faster and better yield of agriculture. In the system, we have used colour segmentation and binary masking to analyse and differentiate between various stages of crop plantation (unripe, ripe and diseased) via aerial images. To further improve accuracy, we have used different sensors to detect important factors like the temperature and moisture of the air and soil. This is going to project precise areas of the affected regions and can be taken care of immediately after detection. Furthermore, using Support Vector Machine (SVM), we have been able to classify different types of leaf diseases up to 98% accuracy. We have also used other algorithms, like K-mean cluster and L*a*b* colour space, to detect the diseased part of the leaves. This will ensure the farmers