You are on page 1of 302
saewtindeererntinainiomasiasctn inthis Contents 18 24 22 23 24 25 26 27 28 Preface xi Acknowledgments xii About the Authors xiii Introduction 1 Preview 1 Background 1 What Is Digital Image Processing? 2 Background on MATLAB and the Image Processing Toolbox Areas of Image Processing Covered in the Book 5 ‘The Book Web Site 6 Notation 7 ‘The MATLAB Working Environment 7 1.7.1 The MATLAB Desktop 7 1.7.2. Using the MATLAB Editor to Create M-Files 9 173. Getting Help 9 L7A_ Saving and Retrieving a Work Session 10 How References Are Organized in the Book 11 Summary 1 Fundamentals 12 Preview 12 Digital Image Representation 12 21.1 Coordinate Conventions 13 21.2 Images as Matrices 14 Reading Images 14 Displaying Images 16 Writing Images 18 Data Classes 23 Image Types 24 26.1 Intensity Images 24 262 Binary images 25 263 ANoteon Terminology 25 Converting between Data Classes and Image Types 25 27.1 Converting becween Data Classes 25 27.2 Converting between Image Classes and Types 26 Anay Indexing 30 281 VectorIndexing 20° 282 Matrix Indexing 3 283 Selecting Array Dimensions 37 29 2.10 3a 32 33 34 4a 42 43 4a a3 Some Important Standard Arrays 37 Introduction to M-Function Programming 38 2101 M-Files 38 2102 Operators 40 2103 Flow Control 49 210.4 Code Optimization 55 2105 Interactive /O 59 2106 A Briel Introduction to Cell Arrays and Structures 62 Summary 64 Intensity Transformations and Spatial Filtering 65 Preview! 65 Background 65 Intensity Transformation Functions 66 S21" Function inadjust 66 332. Lopanittmic and Contrast Stetching Transformations 68 333. Some Uuty MoFunctions for intensity Transformations 70 Histogram Processing and Function Potting 7 531 “Generating and Poting image Histograms 76 332 Histogram Equalization 81 333. Histogram Matching (Specification). 84 Spatial Filtering 89 SHI Linear Spatial Fitering. 69 342 Nonlinear Spatial Filtering 96 Image Processing Toolbox Standard Spatial Filters 99 B51" Linear Spatal Filters 99 352 Nonlinene Spatial ites 104 Summary. 107 Frequency Domain Processing 108 Preview 108 The 2-D Discrete Fourier Transform 108 Computing and Visualizing the 2-D DFT in MATLAB 112 Filtering in the Frequency Domain 115 [31 fundamental Concepts 3 432 Basie Steps in DFT Filtering 121 $33 Am Mefunction for Filtering in the Frequency Domain 122 Oblaining Frequency Domain Filters from Spatial Filters 122 Ceneatigg Fives Directly inthe Trequency Doma 127 sat Cheating Meshgrid Arrays for Ute in Implementing Filters inthe Frequency Domain 128 Towpass Frequency Domain Fters_ 129 WWieerame and Surface Poting, 132 46 5a 52 53 5 55 56 37 38 59 510 sit 61 62 63 6a = Contents vii Sharpening Frequency Domain Filters 136 461 Basic Highpass Filtering 136 462 High-Frequency Emphasis Filtering 138 Summary 140 Image Restoration 141 Preotwo 101 ‘A Model ofthe Image Degradation Restoration Process 142 Noise Models 133 B21" Adding Noe with Function nose 143 522. Goering Spatial Random Note with a Specified Disuibuton 1s 523. Period Nese 150 524. Estimating Noise Parameters 153 Restoration inthe Presence of Noise Only—Spatial Filtering. 158 SS Spatial Nose Filters 159 532. Aaptve Spatial ters 168 Periodic Nese Reduction by Frequency Domain Filtering, 166 Modeling the Degradation Fancion I6e Ditect Inverse Filtering 169 Wiener Filtering 170 Conrtrsned Lest Squares (Regularized) Filtering 173 erative Nonlinear Restoration Using the Luy-Richandson Algorithm 176 Bind Deconvolution 179 Geometic Transformations and Image Registration 182 S11 Geometric Spatal Tarsformatons “182 5112 Applying Spatal Transformation to Images 187 Bits image Reyetraton 1 Summary "193 Color Image Processing 194 Preview 194 Color Image Representation in MATLAB 194 GL RGBlmages 194 612 Indexed images 197 61.3 IPT Functions for Manipulating RGB and indexed Images 199 Converting to Other Color Spaces 204 621 NTSCColor Space 204 622 TheYCbCrColor Space 205 62% The HSV Calor Spare 205 624 The CMY and CMYK Color Spaces 206 625 The HSIColor Space 207 The Basics of Color Image Processing 215 Color Transformations 216 «Contents 65. 66 7a 72 73 Spatial Filtering of Color Images 227 65:1 Color Image Smoothing 227 65.2 Color Image Sharpening 230 Working Directly in RGB Vector Space 251 66.1 Color Edge Detection Using the Gradient 232 662. Image Segmentation in RGB Vector Space 237 Summary 241 Wavelets 242 Preview 242 Background 242 The Fast Wavelet Transform 245 7.2.1 FWTs Using the Wavelet Toolbox 246 72.2 FWTswithout the Wavelet Toolbox 252 Working with Wavelet Decomposition Structures 259 7.3.1 Editing Wavelet Decomposition Coetficients without the Wavelet Toolbox 262, 7.3.2. Displaying Wavelet Decomposition Coefficients 266 The Inverse Fast Wavelet Transform 271 Wavelets in Image Processing 276 Summary 281 Image Compression 282 Proviso 282 Background 283 Coding Redundancy 286 S21 Huffman Coges 289 322 Hulfman Encoding 295 823. Huffman Decoding. 301 Interpixel Redundancy "309 Paychovisual Redundancy 315 JPEG Compression 317 B51 yee. 38 852 JPEG2000 305 Summary 338 Morphological Image Processing 334 Preview 334 Preliminaries 335 9.141 Some Basic Concepts from Set Theory 385 91.2 Binary Images, Sets, and Logical Operators 337 Dilation and Erosion 337 921 Dilation 338 92.2 Structuring Element Decomposition 341 923 The strel Function 341 924 Erosion 345 93 94 95. 96 10 10a 102 103 4 105 i ua 8 Contents ix Combining Dilation and Erosion 347 93.1 Opening and Closing 347 93.2 The Hittor-Miss Transformation 350 933 Using Lookup Tables 353 934 Function banorpn 356 Labeling Connected Components 359 Morphological Reconstruction 362 95.1 Opening by Reconstruction 363 952 Filling Holes 365 95.3. Clearing Border Objects 366 Gray-Scale Morphology 366 9.6.1 Dilation and Erosion 366 92 Opening and Closing 369 9.63 Reconstruction 374 Summary 377 Image Segmentation 378 Previtw 373 Point Line, and Edge Detection 373 1041 Point Detection 979 1012 Line Detection 381 1013 Edge Detection Using Function edge 384 Line Detection Using the Hough Transform 33 1021 Hough Transform Peak Detection 399 1022 Hough Transform Line Detection and Linking 401 Thresholding 404 1031 Global Tresholding 405 1032 Local Thresholding 407 Regioa-Based Segmentation 407 1041 Basic Formulation 407 1042 Region Growing "408 1043 Region Spliting and Merging 412 Segmentation Using the Watershed Transform 417 1051 Watershed Segmentation Using the Distance Transform 418 105.2 Watershed Segmentation Using Gradients 420 1053 Marker-Contolled Watershed Segmentation 42 Summary 425 Representation and Description 426 Proview 426 Background 425 1123 Cell Arays and Structures 427 112 Some Advitional MATLAB and IPT Functions Used inthis Chapter 422 113 Some Basie Uilty M-Functons 483 Contents| 112 Representation 436 3121 Chain Codes 436 11.22 Polygonal Approximations Using Minimum-Perimeter Polygons 439 11.23 Signatures 449 112.4 Boundary Segments 452 1125 Skeletons 453 113 Boundary Descriptors 455 113.1 Some Simple Descriptors’ 455 3132 Shape Numbers 456 11.33 Fourier Descriptors 458 134 Statistical Moments 462 1A Regional Descriptors $63, ALA Function regionprops 463, 1142 Texture 464 i143 Moment Invariants 470 115 Using Principal Components for Description 474 Summary 483 12 object Recognition 484 | 122 Background 484 122 Computing Distance Measures in MATLAB 485 123 Recognition Based on Decsion-Theoretic Methods 488 123 Forming Patern Verto 488 1232 ator Matching Using MinimarDistance Classifiers 489 1233 Matching by Correlation 50 1234 Opaimum Statistical Casiiers $92 1235 Adaptive Leaning Systems, 498 Cy rene meer TLD Working th Strings in MATLAB 499 1242 String Matching 508 pasneach Appendix A Function Summary 514 Aupentic Bice and MATLAB Graphical User Interfaces 527 Aapentx C M-Functions 552 Bibliography 594 Index 597 Preface Solutions to problems in the field of digital image processing generally requite extensive experimental work involving software simulation and testing wit large sets of sample images Although algorithm development typically is based on theoretical ‘underpinnings. the actual implementation of these algorithms almost always requires parameter estimation and, requenty algorithm revision and comparison of candidte Solutions Thus selection ofa flexible, comprehensive, and well-documented software ‘evelopment envisonment isa key factor that has important implications in the cost, ‘development time, and portability of image processing solutions. In spite of its importance, surprisingly litle has been writen on this aspect of the field in the fom of textbook material dealing with both theoretical principles and sof- ‘ware implementation of digital image processing concepts This book was written for just this purpose. Is main objective so provide foundation for implementing image processing algorithms using modem software tools complementary objective was to prepare a book that is selcontained and easly readable by individuals witha basic buckground in digital image processing, mathematical analysis, and computer pro- gramming all at a level typical of that found in a juniorsenior eurticulum ina techai- ‘al discipline Rudimentary knowledge of MATLAB also i desirable. ‘To achieve these objectives, we felt that two key ingredients were needed. The frst was to select image processing material that is representative of material cov- cred in formal course of instruction inthis field, The second was to select soft ‘ware tools that are well supported and documented, and which have a wide range of applications inthe “real” world. “Tomect the fst objective most ofthe theoretical eonceptsin the following chapters were selected fom Digital Image Processing by Gonzsez and Woods, which has been the choie introductory textbook used by educators all ver the world for over two decades The software tools selected ate from the MATLAB Image Processing Toolbox {OPT).which similarly occupies a postion of eminence in both education and industrial pplcations A basic strategy followed in the preparation ofthe book was to provide a seamles integration of wellestablished theoretical concepts and their implementation wing state-of the-art software tools ‘The book is organized along the same lines as Digial Image Processing. In this way, the reader has easy access to a more detailed treatment ofall the image processing ‘concepts discused here, 5 well as an up-to-date set of references for further reading. Following this approach made it possible to present theoretical mate ina sucinct ‘manner and thus we were able to maintain afocuson the software implementation as- ects of image processing problem solutions Because it works in the MATLAB com- Puting environment, the Image Processing Toolbox offers some significant advantages, ot ony in the breadth ofits computational took, but also because it is supported under most operating systems in se today. nique feature of this book sits empia- sis on showing How to develop new code o enhance existing MATLAB and TPT func- tionality. This i an important feature in an area Such as image processing, which, as ‘oted ale, is characterized by the need for extensive algorithm development and experimental work ‘Aller an introduction to the fundamentals of MATLAB functions and program- ming, the book proceeds to address the mainstream areas of image processing. The

You might also like