vii TABLE OF CONTENTS CHAPTER TITLE DECLARATION DEDICATION ACKNOWLEDGEMENT ABSTRACT ABSTRAK TABLE OF CONTENTS LIST OF TABLES LIST OF FIGURES LIST OF ABBREVIATIONS LIST OF SYMBOLS LIST OF APPENDICES 1 INTRODUCTION 1.1 Background of the Study 1.2 Statement of the Problem 1.3 Objective of the Study 1.4 Scope of Work 1.5 Methodology 1.6 Report Outline 2 LITERATURE REVIEW 2.1 Smart Camera 2.1.1 Classification of Smart Cameras 2.1.2 Functionalities of ASIP 2.2 Canny Algorithm 2.2.1 Image Smoothing 2.2.2 Edge Detection 2.2.3 Directional Non-maximum Suppression (DNS) PAGE ii iii iv v vi vii x xii xiv xv xvi 1 1 1 2 2 2 3 4 4 5 7 7 9 10 14 viii 2.3 2.4 2.5 2.6 3 2.2.4 Thresholding Altera Cyclone II Board 2.3.1 DE2 Control Panel Facility NTSC and PAL Standards Bitmap Image Motivation of Extended Work 15 16 17 17 18 18 MODIFIED CANNY ALGORITHM 3.1 Implementing RGB to GrayScale 3.2 Implementing Smoothing in Hardware 3.3 Computing Magnitude and Orientation of Gradient of Image 3.4 Implementing Thinning in Hardware 3.5 Implementing Hysteresis 3.6 Chapter Summary 22 22 23 4 HARDWARE ARCHITECTURE 4.1 Chapter Summary 31 34 5 RESULTS AND DISCUSSION 5.1 Matlab Results 5.1.1 RGB to GrayScale 5.1.2 Smoothing 5.1.3 Magnitude and Direction of Gradient 5.1.4 Directional Non-maximum Suppression (DNS) 5.1.5 Hysteresis 5.2 Co-Design Results 5.2.1 All Steps in NiosII 5.2.2 Computing only Grayscale in Hardware and the Rest in NiosII 5.2.3 Computing only Smoothing in Hardware and the Rest in NiosII 5.2.4 Computing only Magnitude and Direction of Gradient and the Rest in NiosII 5.2.5 Only Thinning in Hardware and the Rest in NiosII 35 35 35 35 38 25 29 29 30 38 39 42 42 42 43 45 46 ix 6 CONCLUSION 6.1 Future Works REFERENCES 52 53 54 x LIST OF TABLES TABLE NO. 2.1 2.2 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 5.11 5.12 5.13 5.14 TITLE Types of smart cameras, typical characteristics, and sample applications. Addresses of different information located in a bitmap header file. Execution time for every step of the canny algorithm in software. Execution time when only computing grayscale is in hardware. Numbers of SOPC builder generated module resources when only computing grayscale is in hardware. Numbers of computing grayscale designed module resources. Execution time when only smoothing in hardware using method1. Execution time when only smoothing in hardware using method2. Numbers of SOPC builder generated module resources when only smoothing is in hardware. Numbers of smoothing designed module resources. Execution time when only computing gradient is in hardware. Numbers of SOPC builder generated module resources when only computing gradient is in hardware. Numbers of computing gradient designed module resources. Execution time when only thinning is in hardware. Numbers of SOPC builder generated module resources when only thinning is in hardware. Numbers of thinning designed module resources. PAGE 5 20 42 43 43 43 44 44 45 45 45 46 46 46 47 47 xi 5.15 5.16 5.17 5.18 5.19 5.20 Execution time for every step of the canny algorithm implemented in hardware. Execution time difference between hardware and software of the canny algorithm. Execution time when computing grayscale, smoothing and computing gradient are in hardware. Numbers of SOPC builder generated module resources for final co-design. Numbers of final co-design, designed module resources. Execution time for different operations. 47 48 48 48 49 50 xii LIST OF FIGURES FIGURE NO. 1.1 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 3.1 3.2 3.3 3.4 3.5 3.6 3.7 TITLE Steps of implementing algorithms on hardware. Functional structure of a smart camera. Classification of smart cameras based on levels of integration. Canny algorithm steps. Gaussian shape in respect to different standard deviations. Gaussian kernel. Image results of a Gaussian function with different standard derivations applied to an image. Additive Gaussian noise applied to images of rows number 2, 3 and 4 with a standard deviation of 0.1,1 and 10 , respectively. Roberts, Prewitt and Sobel masks using for implementing first order derivative in x and y direction. An example of how gradient works. An example of how thresholding works. Altera DE2 development and education board. The DE2 control panel concept. Bitmap header file. Gaussian function. Graphical show of convolution an image with Gaussian mask. Sobel masks in x and y directions. Central pixel and directions of it’s neighbors. Division of trigonometric circle to four directions. Upper half of trigonometric circle. Black central pixel and its corresponding neighbors for thinning, based on the direction. PAGE 3 4 6 9 10 10 10 11 13 14 15 16 17 19 24 24 25 26 27 28 29 xiii 3.8 4.1 4.2 4.3 4.4 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 5.10 5.11 Black central pixel and its corresponding neighbors for thresholding, based on the direction. Sequence of canny algorithm implementation. Hardware architecture of final design. Sequence of passing data from one step to another one. Sequence of input/output data to/from system. Grayscale results using three different methods. Smoothed results using Gaussian mask. The measured bit difference between smoothed images using original and estimated Gaussian mask. Magnitude of gradient. Simple thresholded and thinned image results (T h=100). A horizontal edge with 3 different values. Image results before and after hysteresis (T h=200 and T l=50). Image results before and after hysteresis (T h=100 and T l=50). Matlab results of modified Canny algorithm. A set of pixels; central pixels and corresponding neighbors that should be send to hardware for smoothing. 24bit input image versus binary output image. 30 31 32 33 34 36 37 37 38 39 39 40 41 41 44 49 xiv LIST OF ABBREVIATIONS ASIC - Application Specific Integration Circuit ASIP - Application Specific Information Processing ATSC - Advanced Television Systems Committee DAC - Digital to Analog Converter DNS - Directional Non-maximum Suppression DSP - Digital Signal Processor FPGA - Field Programmable Gate Array HD - High Definition IP - Internet Protocol LED - Light Emitting Diode NTSC - National Television Standards Committee PAL - Phase Alternating Line PLD - Programmable Logic Device RTL - Register Transfer Level SDRAM - Synchronous Dynamic Random Access Memory SOPC - System on a Programmable Chip SRAM - Static Random Access Memory USB - Universal Serial Bus VTR - Video Tape Recorder xv LIST OF SYMBOLS Tl – Low Threshold Value Th – High Threshold Value Hz – Hertz M Bps – Megabytes Per Second M bps – Megabits Per Second M – Mega σ – Standard Derivative –