logo资料库

digital image processing using matlab.pdf

第1页 / 共845页
第2页 / 共845页
第3页 / 共845页
第4页 / 共845页
第5页 / 共845页
第6页 / 共845页
第7页 / 共845页
第8页 / 共845页
资料共845页,剩余部分请下载后查看
Cover
Digital Image Processing Using MATLAB, 2nd Edition
ISBN 978-0-9820854-0-0
Contents
Preface
Acknowledgements
The Book Web Site
About the Authors
1 Introduction
Preview
1.1 Background
1.2 What Is Digital Image Processing?
1.3 Background on MATLAB and the Image Processing Toolbox
1.4 Areas of Image Processing Covered in the Book
1.5 The Book Web Site
1.6 Notation
1.7 The MATLAB Desktop
1.7.1 Using the MATLAB Editor/Debugger
1.7.2 Getting Help
1.7.3 Saving and Retrieving Work Session Data
1.8 How References Are Organized in the Book
Summary
2 Fundamentals
Preview
2.1 Digital Image Representation
2.1.1 Coordinate Conventions
2.1.2 Images as Matrices
2.2 Reading Images
2.3 Displaying Images
2.4 Writing Images
2.5 Classes
2.6 Image Types
2.6.1 Gray-scale Images
2.6.2 Binary Images
2.6.3 A Note on Terminology
2.7 Converting between Classes
2.8 Array Indexing
2.8.1 Indexing Vectors
2.8.2 Indexing Matrices
2.8.3 Indexing with a Single Colon
2.8.4 Logical Indexing
2.8.5 Linear Indexing
2.8.6 Selecting Array Dimensions
2.8.7 Sparse Matrices
2.9 Some Important Standard Arrays
2.10 Introduction to M-Function Programming
2.10.1 M-Files
2.10.2 Operators
2.10.3 Flow Control
2.10.4 Function Handles
2.10.5 Code Optimization
2.10.6 Interactive I/O
2.10.7 An Introduction to Cell Arrays and Structures
Summary
3 Intensity Transformations and Spatial Filtering
Preview
3.1 Background
3.2 Intensity Transformation Functions
3.2.1 Functions imadjust and stretchlim
3.2.2 Logarithmic and Contrast-Stretching Transformations
3.2.3 Specifying Arbitrary Intensity Transformations
3.2.4 Some Utility M-functions for Intensity Transformations
3.3 Histogram Processing and Function Plotting
3.3.1 Generating and Plotting Image Histograms
3.3.2 Histogram Equalization
3.3.3 Histogram Matching (Specification)
3.3.4 Function adapthisteq
3.4 Spatial Filtering
3.4.1 Linear Spatial Filtering
3.4.2 Nonlinear Spatial Filtering
3.5 Image Processing Toolbox Standard Spatial Filters
3.5.1 Linear Spatial Filters
3.5.2 Nonlinear Spatial Filters
3.6 Using Fuzzy Techniques for Intensity Transformations and Spatial Filtering
3.6.1 Background
3.6.2 Introduction to Fuzzy Sets
3.6.3 Using Fuzzy Sets
3.6.4 A Set of Custom Fuzzy M-functions
3.6.5 Using Fuzzy Sets for Intensity Transformations
3.6.6 Using Fuzzy Sets for Spatial Filtering
Summary
4 Filtering in the Frequency Domain
Preview
4.1 The 2-D Discrete Fourier Transform
4.2 Computing and Visualizing the 2-D DFT in MATLAB
4.3 Filtering in the Frequency Domain
4.3.1 Fundamentals
4.3.2 Basic Steps in DFT Filtering
4.3.3 An M-function for Filtering in the Frequency Domain
4.4 Obtaining Frequency Domain Filters from Spatial Filters
4.5 Generating Filters Directly in the Frequency Domain
4.5.1 Creating Meshgrid Arrays for Use in Implementing Filters in the Frequency Domain
4.5.2 Lowpass (Smoothing) Frequency Domain Filters
4.5.3 Wireframe and Surface Plotting
4.6 Highpass (Sharpening) Frequency Domain Filters
4.6.1 A Function for Highpass Filtering
4.6.2 High-Frequency Emphasis Filtering
4.7 Selective Filtering
4.7.1 Bandreject and Bandpass Filters
4.7.2 Notchreject and Notchpass Filters
Summary
5 Image Restoration and Reconstruction
Preview
5.1 A Model of the Image Degradation/Restoration Process
5.2 Noise Models
5.2.1 Adding Noise to Images with Function imnoise
5.2.2 Generating Spatial Random Noise with a Specified Distribution
5.2.3 Periodic Noise
5.2.4 Estimating Noise Parameters
5.3 Restoration in the Presence of Noise Only—Spatial Filtering
5.3.1 Spatial Noise Filters
5.3.2 Adaptive Spatial Filters
5.4 Periodic Noise Reduction Using Frequency Domain Filtering
5.5 Modeling the Degradation Function
5.6 Direct Inverse Filtering
5.7 Wiener Filtering
5.8 Constrained Least Squares (Regularized) Filtering
5.9 Iterative Nonlinear Restoration Using the Lucy-Richardson Algorithm
5.10 Blind Deconvolution
5.11 Image Reconstruction from Projections
5.11.1 Background
5.11.2 Parallel-Beam Projections and the Radon Transform
5.11.3 The Fourier Slice Theorem and Filtered Backprojections
5.11.4 Filter Implementation
5.11.5 Reconstruction Using Fan-Beam Filtered Backprojections
5.11.6 Function radon
5.11.7 Function iradon
5.11.8 Working with Fan-Beam Data
Summary
6 Geometric Transformations and Image Registration
Preview
6.1 Transforming Points
6.2 Affine Transformations
6.3 Projective Transformations
6.4 Applying Geometric Transformations to Images
6.5 Image Coordinate Systems in MATLAB
6.5.1 Output Image Location
6.5.2 Controlling the Output Grid
6.6 Image Interpolation
6.6.1 Interpolation in Two Dimensions
6.6.2 Comparing Interpolation Methods
6.7 Image Registration
6.7.1 Registration Process
6.7.2 Manual Feature Selection and Matching Using cpselect
6.7.3 Inferring Transformation Parameters Using cp2tform
6.7.4 Visualizing Aligned Images
6.7.5 Area-Based Registration
6.7.6 Automatic Feature-Based Registration
Summary
7 Color Image Processing
Preview
7.1 Color Image Representation in MATLAB
7.1.1 RGB Images
7.1.2 Indexed Images
7.1.3 Functions for Manipulating RGB and Indexed Images
7.2 Converting Between Color Spaces
7.2.1 NTSC Color Space
7.2.2 The YCbCr Color Space
7.2.3 The HSV Color Space
7.2.4 The CMY and CMYK Color Spaces
7.2.5 The HSI Color Space
7.2.6 Device-Independent Color Spaces
7.3 The Basics of Color Image Processing
7.4 Color Transformations
7.5 Spatial Filtering of Color Images
7.5.1 Color Image Smoothing
7.5.2 Color Image Sharpening
7.6 Working Directly in RGB Vector Space
7.6.1 Color Edge Detection Using the Gradient
7.6.2 Image Segmentation in RGB Vector Space
Summary
8 Wavelets
Preview
8.1 Background
8.2 The Fast Wavelet Transform
8.2.1 FWTs Using the Wavelet Toolbox
8.2.2 FWTs without the Wavelet Toolbox
8.3 Working with Wavelet Decomposition Structures
8.3.1 Editing Wavelet Decomposition Coefficients without the Wavelet Toolbox
8.3.2 Displaying Wavelet Decomposition Coefficients
8.4 The Inverse Fast Wavelet Transform
8.5 Wavelets in Image Processing
Summary
9 Image Compression
Preview
9.1 Background
9.2 Coding Redundancy
9.2.1 Huffman Codes
9.2.2 Huffman Encoding
9.2.3 Huffman Decoding
9.3 Spatial Redundancy
9.4 Irrelevant Information
9.5 JPEG Compression
9.5.1 JPEG
9.5.2 JPEG 2000
9.6 Video Compression
9.6.1 MATLAB Image Sequences and Movies
9.6.2 Temporal Redundancy and Motion Compensation
Summary
10 Morphological Image Processing
Preview
10.1 Preliminaries
10.1.1 Some Basic Concepts from Set Theory
10.1.2 Binary Images, Sets, and Logical Operators
10.2 Dilation and Erosion
10.2.1 Dilation
10.2.2 Structuring Element Decomposition
10.2.3 The strel Function
10.2.4 Erosion
10.3 Combining Dilation and Erosion
10.3.1 Opening and Closing
10.3.2 The Hit-or-Miss Transformation
10.3.3 Using Lookup Tables
10.3.4 Function bwmorph
10.4 Labeling Connected Components
10.5 Morphological Reconstruction
10.5.1 Opening by Reconstruction
10.5.2 Filling Holes
10.5.3 Clearing Border Objects
10.6 Gray-Scale Morphology
10.6.1 Dilation and Erosion
10.6.2 Opening and Closing
10.6.3 Reconstruction
Summary
11 Image Segmentation
Preview
11.1 Point, Line, and Edge Detection
11.1.1 Point Detection
11.1.2 Line Detection
11.1.3 Edge Detection Using Function edge
11.2 Line Detection Using the Hough Transform
11.2.1 Background
11.2.2 Toolbox Hough Functions
11.3 Thresholding
11.3.1 Foundation
11.3.2 Basic Global Thresholding
11.3.3 Optimum Global Thresholding Using Otsu's Method
11.3.4 Using Image Smoothing to Improve Global Thresholding
11.3.5 Using Edges to Improve Global Thresholding
11.3.6 Variable Thresholding Based on Local Statistics
11.3.7 Image Thresholding Using Moving Averages
11.4 Region-Based Segmentation
11.4.1 Basic Formulation
11.4.2 Region Growing
11.4.3 Region Splitting and Merging
11.5 Segmentation Using the Watershed Transform
11.5.1 Watershed Segmentation Using the Distance Transform
11.5.2 Watershed Segmentation Using Gradients
11.5.3 Marker-Controlled Watershed Segmentation
Summary
12 Representation and Description
Preview
12.1 Background
12.1.1 Functions for Extracting Regions and Their Boundaries
12.1.2 Some Additional MATLAB and Toolbox Functions Used in This Chapter
12.1.3 Some Basic Utility M-Functions
12.2 Representation
12.2.1 Chain Codes
12.2.2 Polygonal Approximations Using Minimum-Perimeter Polygons
12.2.3 Signatures
12.2.4 Boundary Segments
12.2.5 Skeletons
12.3 Boundary Descriptors
12.3.1 Some Simple Descriptors
12.3.2 Shape Numbers
12.3.3 Fourier Descriptors
12.3.4 Statistical Moments
12.3.5 Corners
12.4 Regional Descriptors
12.4.1 Function regionprops
12.4.2 Texture
12.4.3 Moment Invariants
12.5 Using Principal Components for Description
Summary
13 Object Recognition
Preview
13.1 Background
13.2 Computing Distance Measures in MATLAB
13.3 Recognition Based on Decision-Theoretic Methods
13.3.1 Forming Pattern Vectors
13.3.2 Pattern Matching Using Minimum-Distance Classifiers
13.3.3 Matching by Correlation
13.3.4 Optimum Statistical Classifiers
13.3.5 Adaptive Learning Systems
13.4 Structural Recognition
13.4.1 Working with Strings in MATLAB
13.4.2 String Matching
Summary
Appendix A: M-Function Summary
Appendix B: ICE and MATLAB Graphical User Interfaces
Appendix C: Additional Custom M-functions
Bibliography
Index
Second Edition C. Gonzalez E. Woods L. Eddins Rafael University of Tennessee Richard Steven MedData Interactive The Math Works, Inc. Gatesmark Publishing@ A Division of Gatesmark.@ LLC www.gatesmark.com
Library of Congress Cataloging-in-Publication Data on File Library of Congress Control Number: 2009902793 Gatesmark Publishing A Division of Gatesmark, LLC www.gatesmark .com © 2009 by Gatesmark. LLC All rights means, without reserved. written permission from the publisher. No part of this book may be reproduced or transmitted in any form or by any Gatesmark Publishing'" is a registered trademark of Gatesmark. LLC www.gatcsmark.com. Gatesmarkc" is a registered trademark of Gatesmark. LLC. www.gatesmark.com. MATLAB"> is a registered 01760-2098 trademark of The Math Works. Inc .. 3 Apple Hill Drive, Natick, MA include and publisher The authors efforts their effectiveness. consequential programs. The authors of this book have used their best efforts in preparing this book. These the development. research. and testing of the theories and programs to determine damages with. or arising out of. the furnishing. performance. and publisher shall not he liable in any event for incidental or or use of these in the United Stall.!s of America Printed IO 9 8 7 6 5 4 3 2 ISBN 978-0-9820854-0-0
To Ryan and To Janice, David, and Jonathan To Geri, Christopher, and Nicholas
Contents l Introduction Previr?w 1 Preface. xi Acknowledgements xiii About the Authors xv 1 1.1 Background 1 1.2 What Is Digital Image Processing? 2 1.3 Background on MATLAB and the Image Processing 1.4 Areas of Image Processing 1.5 The Book Web Site 7 1.6 Notation 7 1.7 The MATLAB Desktop 7 Covered in the Book 5 Toolbox 4 1 .7.l Using the MATLAB Editor/Debugger 1 .7.2 Getting Help 10 1.7.3 Saving and Retrieving Work Session Data 11 10 1.8 How References Are Organized in the Book 11 Summary 12 2 Fundamentals 13 Preview 13 2.1 Digital Image Representation 13 Conventions 14 2.1.l Coordinate 2.1.2 Images as Matrices 1 5 2.2 Reading Images 1 5 2.3 Displaying Images 18 2.4 Writing Images 21 2.5 Classes 26 2.6 Image Types 27 Images 27 2.6.1 Gray-scale 2.6.2 Binary Images 2.6.3 A Note on Terminology 28 2.7 Converting between Classes 28 2.8 Array Indexing 33 27 l Indexing Vectors 33 Matrices 35 with a Single Colon 37 2.8. 2.8.2 Indexing 2.8.3 Indexing 2.8.4 Logical Indexing 38 2.8.5 Linear Indexing 39 2.8.6 Selecting Array Dimensions 42 v
Vl • Contents 2.8.7 Sparse Matrices 42 2.9 Some Important Standard Arrays 43 2.10 Introduction to M-Function Programming 44 2.10.1 M-Files 44 2.10.2 Operators 46 2.10.3 Flow Control 57 2.10.4 Function 2.10.5 Code Optimization 65 2.10.6 2.10.7 An Introduction Summary 79 Interactive Handles 63 1/0 71 to Cell Arrays and Structures 74 3 Intensity Spatial Filtering 80 Preview 80 Transformations and 3.1 Background 80 3.2 Intensity Transformation Functions 81 3.2.1 Functions imadj ust and stretchlim 82 3.2.2 Logarithmic 3.2.3 Specifying 3.2.4 Some Utility M-functions Arbitrary Intensity for Intensity Transformations 86 and Contrast-Stretching Transformations 84 Transformations 87 3.3 Histogram Processing and Function Plotting 93 3.3.1 Generating 3.3.2 Histogram 3.3.3 Histogram 3.3.4 Function adapth isteq 107 and Plotting 99 Equalization Matching (Specification) 102 Image Histograms 94 3.4 Spatial Filtering 109 3.4.1 Linear Spatial 3.4.2 Nonlinear Filtering 1 09 Spatial Filtering 117 3.5 Image Processing Toolbox Standard Spatial Filters 120 3.5.1 Linear Spatial Filters 1 20 3.5.2 Nonlinear Spatial Filters 1 24 3.6 Using Fuzzy Techniques for Intensity Transformations and Spatial to Fuzzy Sets 1 28 Filtering 128 3.6.1 Background 1 28 3.6.2 Introduction 3.6.3 Using Fuzzy Sets 133 3.6.4 A Set of Custom Fuzzy M-functions 140 3.6.5 Using Fuzzy Sets for Intensity 3.6.6 Using Fuzzy Sets for Spatial Summary 163 Filtering 1 58 155 Transformations 4 Filtering Preview 164 in the Frequency Domain 164
4.1 The 2-D Discrete Fourier Transform 164 4.2 Computing and Visualizing 4.3 Filtering in the Frequency Domain 172 the 2-D OF T in MATLAB 168 • Contents vii 4.3.l Fundamentals 173 4.3.2 Basic Steps in DFT Filtering 178 4.3.3 An M-function for Filtering in the Frequency Domain 179 4.4 Obtaining Frequency Domain Filters 4.5 Generating Filters Directly in the Frequency Domain 185 from Spatial Filters 180 4.5.1 Creating Meshgrid Arrays for Use in Implementing Filters in the Frequency Domain 1 86 4.5.2 Lowpass (Smoothing) 4.5.3 Wireframe Frequency and Surface Plotting 1 90 Domain Filters 187 4.6 Highpass (Sharpening) Frequency Domain Filters 194 4.6.1 A Function for Highpass Filtering 1 94 4.6.2 High-Frequency Emphasis Filtering 197 and Reconstruction 209 4.7 Selective Filtering199 4.7.1 Bandreject 4.7.2 Notchreject Summary 208 and Bandpass Filters 199 and Notchpass Filters 202 5 Image Restoration Preview 209 5.1 A Model of the Image Degradation/Restoration 5.2 Noise Models 211 Process 210 5.2.l Adding Noise to Images with 5.2.2 Generating Function imnoise 211 a Specified Random Noise with Spatial 212 Distribution 5.2.3 Periodic 5.2.4 Estimating Noise 220 Noise Parameters 224 5.3 Restoration in the Presence of Noise Only-Spatial Filtering 229 5.3.1 Spatial 5.3.2 Adaptive Spatial Filters Noise Filters 229 233 5.4 Periodic Noise Reduction Using Frequency Domain Filtering 236 5.5 Modeling the Degradation Function 237 5.6 Direct Inverse Filtering 240 5.7 Wiener Filtering 240 5.8 Constrained 5.9 Iterative Least Squares (Regularized) Using the Lucy-Richardson Nonlinear Restoration Filtering 244 250 Algorithm 246 from Projections 251 5.10 Blind Deconvolution 5.11 Image Reconstruction 5.11.l Background 252 5.11.2 Parallel-Beam Projections 5.11 .3 The Fourier Slice Theorem 5.11.4 Filter Implementation 258 and the Radon Transform 254 and Filtered Backprojections 257
分享到:
收藏