CALIFORNIA STATE UNIVERSITY NORTHRIDGE NOISE REDUCTION AND IMAGE SMOOTHING USING GAUSSIAN BLUR. A graduate project in fulfillment of the requirements For the degree of Masters of Science In Electrical Engineering By Sachin Eswar MAY 2015 The graduate project of Sachin Eswar is approved: _____________________________________ ___________________ Dr. Ramin Roosta, Ph.D. Date _____________________________________ ___________________ Dr. Matthew Radmanesh, Ph.D. Date _____________________________________ ___________________ Dr. Shahnam Mirzaei, Ph.D., Chair Date California State University Northridge ii ACKNOWLEDGEMENT Working on this “Noise Reduction and Image Smoothing using Gaussian Blur” was a source of immense knowledge to me. I would like to express my sincere gratitude to Dr. Shahnam Mirzaei for his encouragement and unlimited support towards completion of my dissertation. His guidance and support are the key points for the completion of my project. I would also like to thank Dr. Ramin Roosta and Dr. Mathew Radmanesh for their extended support, scholarly advice and inspiration in completion of my project successfully. I am grateful to the Department of Electrical and computer engineering for giving me this opportunity and providing me the required knowledge in completing my project. I would also like to thank my family and friends, who encouraged me to extend my reach, and for their love, care and support through all the tough times during my graduation. iii TABLE OF CONTENTS SIGNATURE PAGE: ......................................................................................................... ii ACKNOWLEDGEMENT ................................................................................................. iii LIST OF FIGURES ........................................................................................................... vi ABSTRACT ....................................................................................................................... ix CHAPTER 1: INTRODUCTION ....................................................................................... 1 Introduction on Image Processing: .................................................................................. 1 Introduction on Gaussian/Normal distribution and Filter: .............................................. 2 Gaussian distribution: .................................................................................................. 2 Gaussian Filter: ............................................................................................................ 4 Gaussian Blur .............................................................................................................. 6 CHAPTER 2: FPGA MEMORY UNITS ........................................................................... 9 Block RAM: .................................................................................................................... 9 Write modes:.............................................................................................................. 12 WRITE_FIRST mode: ............................................................................................... 12 READ_FIRST mode: ................................................................................................ 13 NO_CHANGE mode: ................................................................................................ 14 FIFO: ............................................................................................................................. 14 FIFO mode of operation: ........................................................................................... 16 iv CHAPTER 3: GAUSSIAN BLUR PRINCIPLE .............................................................. 21 CHAPTER 4: IMPLEMENTATION OF GAUSSIAN BLUR USING MATLAB ......... 27 Implementing using inbuilt Matlab function: ............................................................... 27 Steps using inbuilt convolution function: .................................................................. 27 Implementing without using inbuilt Matlab function: .................................................. 28 CHAPTER 5: IMPLEMENTATION OF GAUSSIAN BLUR USING FPGA ................ 31 Top level design flowchart: ........................................................................................... 31 Implement Convolution in FPGA: ................................................................................ 32 Generating COE files: ................................................................................................... 34 Finite state machine:...................................................................................................... 35 Displaying the output image using Matlab. .................................................................. 40 CHAPTER 6: SYNTHESIS AND SIMULATION .......................................................... 42 Synthesis using XST: .................................................................................................... 42 Simulation using ISim: .................................................................................................. 47 CHAPTER 7: CONCLUSION ......................................................................................... 51 REFERENCES ................................................................................................................. 52 APPENDIX A: FPGA SUMMARY REPORTS .............................................................. 54 APPENDIX B: SOURCE CODE ..................................................................................... 61 VHDL code for Gaussian Filter module: .................................................................. 61 VHDL test bench for Gaussian Filter module: .......................................................... 76 v LIST OF FIGURES Figure 1: Gaussian distribution ........................................................................................... 3 Figure 2: Gaussian distribution in 3 dimension. ................................................................. 4 Figure 3: Discrete Gaussian Function. ................................................................................ 5 Figure 4: 3-dimensional discrete Gaussian distribution...................................................... 6 Figure 5: Kernel matrix of size 7x7. ................................................................................... 7 Figure 6: Input image sample with random noise. .............................................................. 8 Figure 7: Blurred image sample after applying Gaussian blur .......................................... 8 Figure 8: Single port BRAM pin diagram. ....................................................................... 10 Figure 9: Single port RAM architecture. .......................................................................... 10 Figure 10: Cascaded BRAM/Dual port BRAM pin diagram............................................ 11 Figure 11: Cascaded BRAM architecture. ........................................................................ 12 Figure 12: WRITE_FIRST mode waveform. ................................................................... 13 Figure 13: READ_FIRST mode waveform. ..................................................................... 13 Figure 14: NO_CHANGE mode waveform. .................................................................... 14 Figure 15: FIFO-18 ........................................................................................................... 15 Figure 16: FIFO-36 ........................................................................................................... 15 Figure 17: FIFO capacity .................................................................................................. 16 Figure 18: Read cycle timing diagram. ............................................................................. 17 Figure 19: Synchronous FIFO timing diagram. ................................................................ 18 Figure 20: Dual-Clock FIFO Flag Assertion and De-assertion Latency .......................... 20 Figure 21: Input pixel filtering using Gaussian kernel function. ...................................... 22 vi Figure 22: Matrix convolution algorithm. ........................................................................ 23 Figure 23: Input image that need to be blurred. ................................................................ 24 Figure 24: Blurred image with kernel size 3 and sigma 0.5,2,8. ...................................... 25 Figure 25: Blurred image with kernel size 7 and sigma 0.5,2,8 ....................................... 25 Figure 26: Blurred image with kernel size 11 and sigma 0.5,2,8 .................................... 25 Figure 27: Matlab snippet showing the convolution steps using inbuilt function. ........... 28 Figure 28: Snippet showing zero padding. ....................................................................... 29 Figure 29: Snippet showing the convolution logic. .......................................................... 30 Figure 30: Top level design flowchart showing the project outline. ................................ 31 Figure 31: Flowchart showing the overall process. .......................................................... 33 Figure 32: Matlab snippet to create COE file. .................................................................. 35 Figure 33: Finite state machine. .......................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages89 Page
-
File Size-