VISVESVARAYA TECHNOLOGICAL UNIVERSITY Electronics And
Total Page:16
File Type:pdf, Size:1020Kb
VISVESVARAYA TECHNOLOGICAL UNIVERSITY Belgaum-590014, Karnataka PROJECT REPORT ON DESIGN AND DEVELOPMENT OF A REAL TIME VIDEO PROCESSING BASED PEST DETECTION AND MONITORING SYSTEM ON FPGA Submitted in the partial fulfilment for the award of the degree of Bachelor of Engineering in Electronics and Communication Engg. By SHOBITHA N- (1NH11EC099) SPURTHI N- (1NH11EC107) UNDER THE GUIDANCE OF Dr. Sanjay Jain HOD, ECE Dept., NHCE Department of Electronics & Communication Engineering New Horizon College of Engineering, Bengaluru - 560103, Karnataka. 2014-15 NEW HORIZON COLLEGE OF ENGINEERING (Accredited by NBA, Permanently affiliated to VTU) Kadubisanahalli, Panathur Post, Outer Ring Road, Near Marathalli, Bengaluru-560103, Karnataka DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGG. CERTIFICATE This is to certify that the project work entitled DESIGN AND DEVELOPMENT OF A REAL TIME VIDEO PROCESSING BASED PEST DETECTION AND MONITORING SYSTEM ON FPGA is a bonafide work carried out by SHOBITHA N, SPURTHI N bearing USN 1NH11EC099, 1NH11EC107 in partial fulfilment for the award of degree of Bachelor of Engineering in Electronics & Communication Engg. of the Visvesvaraya Technological University, Belgaum during the academic year 2014 - 15. It is certified that all corrections/suggestions indicated for internal assessment has been incorporated in the project report deposited in the departmental library & in the main library. This project report has been approved as it satisfies the academic requirements in respect of project work prescribed for the Bachelor of Engineering Degree in ECE. …………………….. ……………………… ……………………... Guide HoD Principal Dr. Sanjay Jain Dr. Sanjay Jain Dr. Manjunatha Names of the Students: (i) SHOBITHA N (ii) SPURTHI N University Seat Numbers: (i) 1NH11EC099 (ii) 1NH11EC107 External Viva / Orals Name of the internal / external examiner Signature with date 1…………………………… ………………. 2…………………………… .. …………….. ACKNOWLEDGEMENT The satisfaction that accompanies the successful completion of any task would be incomplete without due reverence given to those who made it possible, whose constant guidance and encouragement crowned our efforts with success. We convey our sincere gratitude to Dr. Manjunath, Principle, NHCE, Bangalore for facilities provided in college and for the support in numerous ways. We remain indebted to Dr. Sanjay Jain, HOD, Department of E&C, NHCE for providing us permission to take up the project work. We would like to express our profound gratitude to our internal guide Dr. Sanjay Jain lecturer, Department of E&C, NHCE. We would also like to express our heartfelt gratitude and indebtedness to our external advisor Mr. Sudhir Rao, Project Manager, World Serve Education for his inspiration and support at each and every stage of the project. We could not have reaped such good results and overwhelming appraisals without his support of knowledge and unbiased help. Shobitha. N Spurthi. N i ABSTRACT Agriculture is an important part of India‘s economy and at present it is among the top two farm producers in the world. This sector provides approximately 52 percent of the total number of jobs available in India and contributes among 18.1 percent in GDP. Agriculture is the only means of living for almost two-thirds of the employed class in India. As being stated by the economic data of financial year 2006-07, agriculture has required 18 percent of India‘s GDP. The agriculture sector of India has occupied almost 43 percent of India‘s geographical area. Therefore agriculture is very important for a country like India. … [1] There are many problems faced by farmers. Some of them are as follows Irrigation: It is the artificial application of water to the land or soil. It is used to assist in the growing of agricultural crops, maintenance of landscapes, and re-vegetation of disturbed soils in dry areas and during periods of inadequate rainfall. Storage: The action or method of storing something for future use. Attack of insects/pests: Any organism that damages crops, injuries or irritates livestock or man, or reduces the fertility of land. …[2] In our project we concentrate on attack of insects/pests problem. Nowadays pest monitoring is being done by manual inspection and by spraying pesticides. But the major problem caused by manual inspection is that they cannot monitor the crops 24/7 and also the problem caused by spraying pesticides is that due to the spraying of large quantity, the skin of the farmers is affected and also the consumers are affected by these spraying of pesticides. Therefore we plan to automate the process of pest monitoring, detection and spraying pesticides only when required using video processing/ real time techniques. ii Acknowledgement i Abstract ii List of contents iii List of figures vi LIST OF CONTENTS CHAPTER I: INTRODUCTION 1-2 1.1 Introduction 1 1.2 Literature Survey 1 1.3 Hardware Components Used 1 1.4 Software Components Used 2 1.5 Methodology 2 CHAPTER II: WHAT IS IMAGE PROCESSING 3-15 2.1 Purpose of Image Processing 3 2.2 Types 3 2.3 Pixels, Image sizes and Aspect ratio 4-7 2.3.1 Pixels 4 2.3.2 Aspect ratios 6 2.3.3 Bits per pixel 7 2.3.4 Sub pixels 7 2.4 How does camera work? 8-14 2.4.1 Camera: Focus 10 2.4.2 Understanding the basics 11 2.4.3 A web camera 11 2.4.4 Resolution 11 2.4.5 How big are the sensors? 12 2.4.6 Capturing color: Beam Splitter 12 2.4.7 Compression 12 2.4.8 Controlling light 13 2.4.9 Aperture 13 2.4.10 Shutter speed 13 2.4.11 Exposing the sensors 13 2.4.12 Lens and focal length 14 2.4.13 Cameras work 14 2.4.14 Optical zoom vs. Digital zoom 14 CHAPTER III: COLOR IMAGE PROCESSING 16-26 3.1 Color fundamentals 16 iii 3.2 Perception of colors by the Human eye 16 3.3 Characteristics of colors 17 3.4 Color models 19-26 3.4.1 The RGB color model 19 3.4.2 XYZ (CIE) 21 3.4.3 The CMY and CMYK color model 21 3.4.4 The YCbCr color model 22 3.4.5 The HSI color model 24 3.4.6 Color planes, perpendicular to intensity axis 24 3.4.7 Converting colors from RGB to HSI 25 3.4.8 The HSI color models 25 3.4.9 Conversion color from HSI to RGB 25 3.4.10 Manipulation of HSI images 26 3.4.11 Color complements 26 CHAPTER IV: SEGMENTATION 27-28 4.1 Thresholding 27 4.2 Edge Based Segmentation 27 4.3 Region Based Segmentation 28 CHAPTER V: MORPHOLOGICAL OPERATION 29-31 5.1 Morphological dilation of a Binary image. 29 5.2 Morphological dilation of a Grayscale image. 30 5.3 Dilating an image 30 5.4 Eroding an image 31 5.5 Combining Dilation and Erosion 31 CHAPTER VI: IMPLEMENTATION OF PROJECT 32-38 6.1 Webcamera 32 6.2 FPGA 32 6.3 Block diagram 32 6.4 MATLAB 33 6.4.1 Flow chart 33 6.5 Simulink 34-36 6.5.1 From a video device. 34 6.5.2 MATLAB function: Segmentation. 35 iv 6.5.3 Thresholding segmentation. 35 6.5.4 Erosion 35 6.5.5 Dilation 36 6.6 FPGA 36-37 6.6.1 FPGA design and programming. 37 6.6.2 FPGA applications. 37 CHAPTER VII: RESULTS 39-40 7.1 Output after every block 39 Advantages and Disadvantages 41 Applications 41 Future scope 41 Conclusion 41 APPENDIX FPGA – Introduction 42 Webcamera 43 iBall face2face K20 Features Specifications Introduction to MATLAB 44 What is MATLAB? Introduction to Simulink 44 Bibliography 45 v LIST OF FIGURES Fig 2.1 Block diagram of Image Processing. Fig 2.2 Pixels. Fig 2.3 A photograph of sub-pixel display elements on a laptop‘s LCD screen. Fig 2.4 Pixilated images. Fig 2.5 Geometry of color elements of various CRT and LCD displays –phosphor dots in a color CRT display (top row) bear no relation to pixels or sub pixels. Fig 2.6 Formation of image using convex lens. Fig 2.7 Formation of image using concave lens. Fig 2.8 Different stages of an Image Fig 2.9 How the original (left) image is split in a beam splitter. Fig 3.1 Color spectrum seen by passing white light through a Prism. Fig 3.2 Wavelengths comparing the visible range of the electromagnetic spectrum. Fig 3.3 Absorption of light by the Red, Green and Blue cones in the human eye as the function of wavelength. Fig 3.4 Primary and secondary colors of light and pigments. Fig 3.5 Chromaticity Diagram. Fig 3.6 Typical color gamut of color monitors(triangle) and color printing devices( irregular region). Fig 3.7 The RGB color model. Fig 3.8 Schematic of the RGB Color Cube. Points along the main diagonal have gray values, from black at the origin to white at point (1,1,1). Fig 3.9 RGB 24- bit color cube. Fig 3.10 Bayer filter Mosaic of Bayer RGB pattern. Fig 3.11 Demosaicking process. Fig 3.12 The CMYK color model. Fig 3.13 A visualization of YCbCr color space. Fig 3.14 A color image and its Y, CB and CR components. The Y image is essentially a greyscale copy of the main image. Fig 3.15 RGB to YCbCr Conversion. vi Fig 3.16 Conceptual Relationship between the RGB and HSI color models. Fig 3.17 Hue and saturation in the HSI color model. Fig 3.18 The HSI color model based on (a) triangualar color planes and (b) circular color planes. Fig 3.19 Complements on the color circle. Fig 4.1(a) Thresholding Fig 4.1(b) Edge-based segmentation Fig 4.1(c) Region-based segmentation Fig 5.1 Processing for a Grayscale Image Fig 5.2 Understanding Structural Element Fig 5.3 Original and Dilated image Fig 5.4 Original and Eroded image Fig 6.1 Webcamera Fig 6.2 Block Diagram Fig 6.3 Simulink Block Diagram Fig 7.1 output of each image vii 1 Design and development of a real time video…….