Digital Image Processing Using MATLAB
Second Edition
Rafael C. Gonzalez
University of Tennessee
Richard E. Woods
MedData Interactive
Steven L. Eddins
The MathWorks, Inc.
Contents
Preface. xi
Acknowledgements xiii
About the Authors xv
l Introduction 1
Previr?w 1
1.1 Background 1
1.2 What Is Digital Image Processing? 2
1.3 Background on MATLAB and the Image Processing Toolbox 4
1.4 Areas of Image Processing Covered in the Book 5
1.5 The Book Web Site 7
1.6 Notation 7
1.7 The MATLAB Desktop 7
1.7.l Using the MATLAB Editor/Debugger 10
1 .7.2 Getting Help 10
1.7.3 Saving and Retrieving Work Session Data 11
1.8 How References Are Organized in the Book 11
Summary 12
2 Fundamentals 13
Preview 13
2.1 Digital Image Representation 13
2.1.l Coordinate Conventions 14
2.1.2 Images as Matrices 15
2.2 Reading Images 15
2.3 Displaying Images 18
2.4 Writing Images 21
2.5 Classes 26
2.6 Image Types 27
2.6.1 Gray-scale Images 27
2.6.2 Binary Images 27
2.6.3 A Note on Terminology 28
2.7 Converting between Classes 28
2.8 Array Indexing 33
2.8.l Indexing Vectors 33
2.8.2 Indexing Matrices 35
2.8.3 Indexing with a Single Colon 37
2.8.4 Logical Indexing 38
2.8.5 Linear Indexing 39
2.8.6 Selecting Array Dimensions 42
vVl • 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 Handles 63
2.10.5 Code Optimization 65
2.10.6 Interactive 1/0 71
2.10.7 An Introduction to Cell Arrays and Structures 74
Summary 79
3 Intensity Transformations and
Spatial Filtering 80
Preview 80
3.1 Background 80
3.2 Intensity Transformation Functions 81
3.2.1 Functions imad j ust and st retchlim 82
3.2.2 Logarithmic and Contrast-Stretching Transformations 84
3.2.3 Specifying Arbitrary Intensity Transformations 86
3.2.4 Some Utility M-functions for Intensity Transformations 87
3.3 Histogram Processing and Function Plotting 93
3.3.1 Generating and Plotting Image Histograms 94
3.3.2 Histogram Equalization 99
3.3.3 Histogram Matching (Specification) 102
3.3.4 Function adapt histeq 107
3.4 Spatial Filtering 109
3.4.1 Linear Spatial Filtering 109
3.4.2 Nonlinear Spatial Filtering 117
3.5 Image Processing Toolbox Standard Spatial Filters 120
3.5.1 Linear Spatial Filters 120
3.5.2 Nonlinear Spatial Filters 124
3.6 Using Fuzzy Techniques for Intensity Transformations and Spatial
Filtering 128
3.6.1 Background 128
3.6.2 Introduction to Fuzzy Sets 128
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 Transformations 155
3.6.6 Using Fuzzy Sets for Spatial Filtering 158
Summary 163
4 Filtering in the Frequency Domain 164
Preview 1644.1 T he 2-D Discrete Fourier Transform 164
4.2 Computing and Visualizing the 2-D OF T in MATLAB 168
4.3 Filtering in the Frequency Domain 172
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 from Spatial Filters 180
4.5 Generating Filters Directly in the Frequency Domain 185
4.5.1 Creating Meshgrid Arrays for Use in Implementing Filters
in the Frequency Domain 186
4.5.2 Lowpass (Smoothing) Frequency Domain Filters 187
4.5.3 Wireframe and Surface Plotting 190
4.6 Highpass (Sharpening) Frequency Domain Filters 194
4.6.1 A Function for Highpass Filtering 194
4.6.2 High-Frequency Emphasis Filtering 197
4.7 Selective Filtering199
4.7.1 Bandreject and Bandpass Filters 199
4.7.2 Notchreject and Notchpass Filters 202
Summary 208
5 Image Restoration and Reconstruction 209
Preview 209
5.1 A Model of the Image Degradation/Restoration Process 210
5.2 Noise Models 211
5.2.l Adding Noise to Images with Function imnoise 211
5.2.2 Generating Spatial Random Noise with a Specified
Distribution 212
5.2.3 Periodic Noise 220
5.2.4 Estimating Noise Parameters 224
5.3 5. Restoration 3.1 Spatial inNoise the Presence Filters of 229Noise Only-Spatial Filtering 229
5.3.2 Adaptive Spatial Filters 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 Least Squares (Regularized) Filtering 244
5.9 Iterative Nonlinear Restoration Using the Lucy-Richardson
Algorithm 246
5.10 Blind Deconvolution 250
5.11 Image Reconstruction from Proj ections 251
5.11.l Background 252
5.11.2 Parallel-Beam Projections and the Radon Transform 254
5.11 .3 The Fourier Slice Theorem and Filtered Backprojections 257
5.11.4 Filter Implementation 258
• Contents viiviii • Contents
5.11.5 Reconstruction Using Fan-Beam Filtered Backprojections 259
5.11.6 Function radon 260
5.11.7 Function iradon 263
5.11.8 Working with Fan-Beam Data 268
Summary 277
6 Geometric Transformations and Image
Registration 278
Preview 278
6.1 Transforming Points 278
6.2 Affine Transformations 283
6.3 Projective Transform ations 287
6.4 Applying Geometric Transform ations to Images 288
6.5 Image Coordinate Systems in MATLAB 291
6.5.1 Output Image Location 293
6.5.2 Controlling the Output Grid 297
6.6 Image Interpolation 299
6.6.1 Interpolation in Two Dimensions 302
6.6.2 Comparing Interpolation Methods 302
6.7 Image Registration 305
6.7.1 Registration Process 306
6.7.2 Manual Feature Selection and Matching Using cpselect 306
6.7.3 Inferring Transformation Parameters Using cp2tform 307
6.7.4 Visualizing Aligned Images 307
6.7.5 Area-Based Registration 311
6.7.5 Automatic Feature-Based Registration 316
Summary 317
7 Color Image Processing 318
Preview 318
7.1 Color Image Representation in MATLAB 318
7.1.1 RGB Images 318
7.1.2 Indexed Images 321
7.1.3 Functions for Manipulating RGB and Indexed Images 323
7.2 Converting Between Color Spaces 328
7.2.l NTSC Color Space 328
7.2.2 The YCbCr Color Space 329
7.2.3 The HSY Color Space 329
7.2.4 The CMY and CMYK Color Spaces 330
7.2.5 The HSI Color Space 331
7.2.6 Device-Independent Color Spaces 340
7.3 T he Basics of Color Image Processing 349
7.4 Color Transformations 350
7.5 Spatial Filtering of Color Images 3607.5.1 Color Image Smoothing 360
7.5.2 Color Image Sharpening 365
7.6 Working Directly in RGBVector Space 366
7.6.1 Color Edge Detection Using the Gradient 366
7.6.2 Image Segmentation in RGB Vector Space 372
Summary 376
8 Wavelets 377
Preview 377
8.1 Background 377
8.2 T he Fast Wavelet Transform 380
8.2.1 FWTs Using the Wavelet Toolbox 381
8.2.2 FWTs without the Wavelet Tool box 387
8.3 Working with Wavelet Decomposition Structures 396
8.3.l Editing Wavelet Decomposition Coefficients without the
Wavelet Toolbox 399
8.3.2 Displaying Wavelet Decomposition Coefficients 404
8.4 T he Inverse Fast Wavelet Transform 408
8.5 Wavelets in Image Processing 414
Summary 419
9 Image Compression 420
Preview 420
9.1 Background 421
9.2 Coding Redundancy 424
9.2.1 Huffman Codes 427
9.2.2 Huffman Encoding 433
9.2.3 Huffman Decoding 439
9.3 Spatial Redundancy 446
9.4 Irrelevant Information 453
9.5 JPEG Compression 456
9.5.1 JPEG 456
9.5.2 JPEG 2000 464
9.6 Video Compression 472
9.6.1 MATLAB Image Sequences and Movies 473
9.6.2 Temporal Redundancy and Motion Compensation 476
Summary 485
l 0 Morphological Image Processing 486
Preview 486
10.1 Preliminaries 487
10.1.1 Some Basic Concepts from Set Theory 487
10.1.2 Binary Images, Sets, and Logical Operators 489
10.2 Dilation and Erosion 490
• Contents ixX • Contents
10.2.1 Dilation 490
10.2.2 Structuring Element Decomposition 493
10.2.3 The st rel Function 494
10.2.4 Erosion 497
10.3 Combining Dilation and Erosion 500
10.3.1 Opening and Closing 500
10.3.2 The Hit-or-Miss Transformation 503
10.3.3 Using Lookup Tables 506
10.3.4 Function bwmorph 511
10.4 Labeling Connected Components 514
10.5 Morphological Reconstruction 518
10.5.1 Opening by Reconstruction 518
10.5.2 Filling Holes 520
10.5.3 C learing Border Objects 521
10.6 Gray-Scale Morphology 521
10.6.l Dilation and Erosion 521
10.6.2 Opening and Closing 524
10.6.3 Reconstruction 530
Summary 534
11 Image Segmentation 535
Preview 535
11.1 Point, Line, and Edge Detection 536
11.1.1 Point Detection 536
11.1.2 Line Detection 538
11.1.3 Edge Detection Using Function edge 541
11.2 Line Detection Using the Hough Transform 549
11.2.1 Background 551
11.2.2 Toolbox Hough Functions 552
11.3 T hresholding 557
11.3.1 Foundation 557
11.3.2 Basic Global Thresholding 559
11.3.3 Optimum Global Thresholding Using Otsu’s Method 561
11.3.4 Using Image Smoothing to Improve Global Thresholding 565
11.3.5 Using Edges to Improve Global Thresholding 567
11.3.6 Variable Thresholding Based on Local Statistics 571
11.3.7 Image Thresholding Using Moving Averages 575
11.4 Region-Based Segmentation 578
11.4.1 Basic Formulation 578
11.4.2 Region Growing 578
11.4.3 Region Splitting and Merging 582
11.5 Segmentation Using the Watershed Transform 588
11.5.1 Watershed Segmentation Using the Distance Transform 589
11.5.2 Watershed Segmentation Using Gradients 591
11.5.3 Marker-Controlled Watershed Segmentation 593Summary 596
12 Representation and Description 597
Preview . 597
12.1 Background 597
12.1.1 Functions for Extracting Regions and Their Boundaries 598
12.1.2 Some Additional MATLAB and Toolbox Functions Used
in This Chapter 603
12.1.3 Some Basic Utility M-Functions 604
12.2 Representation 606
12.2.l Chain Codes 606
12.2.2 Polygonal Approximations Using Minimum-Perimeter
Polygons 610
12.2.3 Signatures 619
12.2.4 Boundary Segments 622
12.2.5 Skeletons 623
12.3 Boundary Descriptors 625
12.3.1 Some Simple Descriptors 625
12.3.2 Shape Numbers 626
12.3.3 Fourier Descriptors 627
12.3.4 Statistical Moments 632
12.3.5 Comers 633
12.4 Regional Descriptors 641
12.4.1 Function regionprops 642
12.4.2 Texture 644
12.4.3 Moment Invariants 656
12.5 Using Principal Components for Description 661
Summary 672
13 Object Recognition 674
Preview 674
13.1 Background 674
13.2 Computing Distance Measures in MATLAB 675
13.3 Recognition Based on Decision-Theoretic Methods 679
13.3.1 Forming Pattern Vectors 680
13.3.2 Pattern Matching Using Minimum-Distance Classifiers 680
13.3.3 Matching by Correlation 681
13.3.4 Optimum Statistical Classifiers 684
13.3.5 Adaptive Leaming Systems 691
13.4 Structural Recognition 691
13.4.1 Working with Strings in MATLAB 692
13.4.2 String Matching 701
Summary 706
xiAppendix A
Appendix 8
Appendix (
M-Function Summary 707
ICE and MATLAB Graphical User
Interfaces 724
Additional Custom
M-functions 750
Bibliography 813
Index 817
Symbols
4-connectivity 5 1 5
8-connectivity 5 1 5
: (colon i n M ATLAB) 33
. (dot) 46
. . . (dots for long equations) 24
. mat. See MAT-file
@ operator 63
» (prompt) 8
; (semicolon in MATLAB) 1 6
A
abs 168
adapthisteq 108
Adjacency 5 1 5
adpmedian 235
aggfcn 149
AND 53
elementwise 53
scalar 53
angle 1 7 1
annotation 1 02
ans 55
appcoef2 398
applycform 344
applylut 507
approxfcn 1 5 2
Arctangent 165, 367
four quadrant 1 65, 367. See also
atan2
Array 15. 42. See also Matrix
operations 47
preallocating 65
selecting dimension 42
standard 43
vs. matrix 1 5
atan2 170
Autocorrelation 682
Average image power 241
axis 96
axis i j (moves axis origin) 96
axis off 1 91
axis on 1 91
axis xy (moves axis origin) 96
B
Background 489, 498, 509, 5 1 4, 557,
498
nonuniform 527, 532, 549, 558, 57 1
bandfilter 1 99
bar 95
bayesgauss 685
bellmf 145, 157
Binary image. See Image
bin2dec 438
Bit depth. See Color image processing
blanks 692
Blind deconvolution. See Image
restoration
blkproc 459
Book web site 7
Border. See Boundary, Region
bound2eight 605
bound2four 605
bound2im 600
Boundaries
functions for extracting 598
Boundary 598. See also Region
axis (major, minor) 626
basic rectangle 626
changing direction of 599
connecting 605
defined 598
diameter 626
eccentricity 626
length 625
minimally connected 598
minimum-perimeter polygons 6 1 0
ordering a random sequence of
boundary points 605
segments 622
break 58, 6 1
bsubsamp 605
bsxfun 676
bwboundaries 599
bwdist 589
bwhitmiss 505
bwlabel 515
bwmorph 51 1
bwperim 598
c
cart2pol 621
Cartesian product 487
Cassini spacecraft 206
cat 3 1 9
CDF. See Cumulative distribution
function
ceil 171
cell 392, 431
Cell arrays 74
example 76
celldisp 75, 431
cellfun 75
cellplot 431
cellstr 692
Cellular complex 612
817818 • Index
Center of frequency rectangle 1 71
Center of mass 5 1 6, 643
cform structure 344
Chain codes. See Representation and
description
char 26, 73
checkerboard 238
circshift 604
Circular convolution. See
Convolution
Classes. See also Image classes
converting between 28
list 26
terminology 28
Classification. See Recognition
clc 9
clear 9
Clipping 30
C MEX-file 442
cnotch 202
Code. See also Function.
Programming
combining statements 32
long lines 24
modular 2 1 6
optimization 65
preallocation 65
vectorization 68
col2im 460
colfilt 1 1 8
colon 33
colorgrad 369
Colon notation. See Notation
Color image processing
basics of 349
bit depth 3 1 8
brightness 340
chromaticity 340
chromaticity diagram 341
CIE 34 1
color balancing 358
color correction 358
color edge detection 366
color editing 352
color gamut 347
color image segmentation 372
color map 32 1
color map matrix 32 1
color maps 324
color profile 33 1 , 346
color space
CMY 330
CMYK 330
device independent 340
HSI 33 1
HSY 329
L*a*b* 344
L*ch 344
NTSC 328
RGB 3 1 9
sRGB 343
u’v’L 344
uvL 344
xyY 341
XYZ 341
YCbCr 329
color transformations 350
converting between CIE and sRGB
344
converting between color spaces
328
converting between RGB, indexed,
and gray-scale images. 324
converting HSI to RGB 334
converting RGB to HSI 334
dithering 323, 326
extracting RGB component images
3 1 9
full-color transformation 351
gamut mapping 347
gradient of a vector 368
gradient of image 366
graphical user interface (GUI) 353
gray-level slicing 325
gray-scale map 32 1
histogram equalization 359
hue 328, 332, 340
ICC color profiles 346, 347
image sharpening 365
image smoothing 360
indexed images 321
intensity 332
luminance 320
line of purples 342
manipulating RGB and indexed
images 323
perceptual uniformity 343
primaries of light 3 1 9
pseudocolor mapping 351
RGB color cube 3 19
RGB color image 3 1 8
R G B values o f colors 322
saturation 328, 332, 340
secondaries of light 3 1 9
shade 329
soft proofing 347
spatial filtering 360
tint 329
tone 329
trichromatic coefficients 340
tristimulus values 340
colormap 1 9 1 , 323
colorseg 373
Column vector. See Vector
Command-function duality 24
compare 423
computer 55
Conjugate transpose 33
Connected
component 5 1 5, 597
pixels 597
set 598
connectpoly 605
continue 58, 62
Contour. See Boundary
Contrast
enhancement. See Image
enhancement
measure of, 667
stretching. See Image enhancement
Control points. See Geometric
transformations
conv2 393
converting between linear and
subscript 40
Convex
deficiency 622
hull 622
vertex 6 1 2
Convolution
circular 1 74
expression 1 1 4. 244
filter 1 1 0
frequency domain 173
kernel 1 1 0
mask 1 10
mechanics 1 10
spatial 80
theorem 1 73
Convolution theorem 1 73
conwaylaws 509
Co-occurrence matrix.
See Representation and
description
image 1 4
MATLAB 1 4
Coordinates 1 4
Cartesian 1 92. 62 1
image 1 3
pixel 1 4
polar 257, 62 1 . 654
row and column 1 4
spatial 1 4
copper 323
Corner 633
Corner detection. See Representation
and description
cornermetric 638
cornerprocess 638
Correlation 1 1 4, 68 1
coefficient 3 1 2. 682
expression 1 1 4
mechanics 1 10
normalized cross-correlation 3 1 2
spatial 1 1 0
theorem 242
Correlation coefficient.
See Correlation
Covariance matrix 684
approximation 662
function for computing 663
covmat rix 663
cpselect 306
Cross-correlation 3 1 2, 682. See also
Recognition
CT 25 1
cumsum IOI
Cumulative distribution function 99,
2 1 2
transformation 99
table of 2 1 4
Current directory. See MATLABCurvature. See Representation and
description
Custom function 2. 7
cv2tifs 483
Cygnus Loop 587
D
de component 1 65
dec2base 700
dec2bin 436, 446
deconvblind 250
deconvlucy 247
Deconvolution. See Image restoration
deconvreg 245
deconvwnr 241
defuzzify 1 49
Descriptor. See Representation and
description
detcoef2 398
DFf.See Discrete Fourier transform
dftfilt 179
dftuv 1 86
diag 374
diameter 626
diff 529
Digital image. See Image
Digital image processing, definition 3
Dimension
array 1 6
singleton 1 7
Directory 1 6
Discrete cosine transform (OCT) 456
Discrete Fourier transform (DFf)
centering 1 67, 1 68
computing 1 68
defined 1 64, 1 65
filtering. See Frequency domain
filtering
inverse 165
periodicity 1 66
phase angle 1 65
power spectrum 1 66
scaling issues 1 72
spectrum 1 65
visualizing 1 68
wraparound error 174
disp 7 1
Displacement variable 1 14
Distance 372
computing in MATLAB 675
Euclidean 343, 372, 675
Mahalanobis 373, 678, 684
transform 589
dither 323
Division by zero 47
doc 10
Don’t care pixel 506
Dots per inch. See Dpi
double 26
Dpi 24
dwtmode 387
E
edge 542
Edge detection. See Image
segmentation
edgetaper 242
edit 46
eig 665
Eigenvalues 637, 663
for corner detection 637
Electromagnetic spectrum 2
Elementwise operation. See
Operation.
else 58
elseif 58
end 34
End point 507
endpoints 507
Entropy 645, 65 1
eps 55
error 59
eval 694
Extended minima transform 595
eye 44
F
Faceted shading 193
false 44, 587
False contouring 23
fan2para 274
fanbeam 269
Fast wavelet transform (FWT) 380
fchcode 607
Features 306, 625, 674. See also
Representation and
description
fft2 168
fftshift 1 69
Fields. See Structures
figure 1 9
filter 575
Filter(ing)
frequency domain. See Frequency
domain filtering
morphological. See Morphology
spatial. See Spatial filtering
find 2 1 5
f i x 1 52
fliplr 262
flipud 262
Floating point number. See Number
floor 1 7 1
for 58, 59
Foreground 489, 490, 503, 507, 557,
598
format 56
Fourier
coefficients 1 65
descriptors 627
Slice theorem 257
spectrum 1 65
• Index 819
transform. See Discrete Fourier
transform (DFf)
fplot 98, 156
frdescp 629
Freeman chain codes. See
Representation and
description
Frequency
domain 1 65
convolution 1 73
rectangle 1 65
rectangle center 1 7 1
variables 1 65
Frequency domain filtering
bandpass 1 99
bandreject 1 99
basic steps 1 78
constrained least squares 244
convolution 1 73
direct inverse 240
fundamentals 1 73
high-frequency emphasis 1 97
highpass 1 94
lowpass 1 87
M-function for 1 79
notchpass 202
notchreject 202
periodic noise reduction 236
steps 1 78
Wiener 240
Frequency domain filters. See
also Frequency domain
filtering
bandpass 1 99
bandreject 1 99
Butterworth bandreject 1 99
Butterworth highpass 1 95
Butterworth lowpass 1 87
constrained least squares 244
converting to spatial filters 1 8 1
direct inverse 240
from spatial filters 1 80
Gaussian highpass 1 95
Gaussian lowpass 1 88
generating directly 1 85
high-frequency emphasis 1 97
highpass 1 94
ideal bandreject 1 99
ideal highpass 1 95
ideal lowpass 1 87
notchreject 202
padding 1 74
periodic noise reduction 236
plotting 1 90
pseudoinverse. See Image
restoration
Ram-Lak 259, 266
sharpening 1 94
Shepp-Logan 259
smoothing 1 87
transfer function 1 73
Wiener 240
zero-phase-shift 1 79
freqz2 1 8 1820 • Index
fspecial 1 20
full 43
Function
body 45
comments 45
custom 7
decision 679
discriminant 679
factories 1 4 1
function-generating 141
HI line 45
handle 63, 66, 1 1 9
anonymous 64
named 63
simple 63
help text 45
M-file 4, 1 0
components of 45
M-function 4, 44
nested, 140
programming. See Programming
subfunction 45
windowing. See Windowing
functions
wrapper 298
fuzzyfilt 1 62
Fuzzy processing
aggregation 1 35, 1 38
aggregation, function for 1 49
custom membership functions 143
definitions 1 29
defuzzification 136, 1 38
defuzzification, function for 149
degree of membership 1 29
ELSE rule 1 39
fuzzification 1 33
fuzzy set 1 29
general model 1 39
IF-THEN rules 1 33
antecedent 1 33
conclusion 1 33
consequent 1 33
firing level 1 39
premise 1 33
strength level 1 39
implication 1 34, 137
implication, function for 147
improving performance 1 5 1
inference 1 34
intensity transformations 155
lambda functions 1 46
linguistic value 1 33
linguistic variable 1 33
logical operations 137
membership function 1 29, 131
overall system function 1 50
rule strength, function for 146
spatial filtering 1 58
universe of discourse 129
using fuzzy sets 1 33
fuzzysysfcn 1 50
G
Gaussian bandreject 1 99
gca 96
Generalized delta functions. See
Image reconstruction
Geometric transformations
affine transformations 283
affine matrix 284
similarity transformations 285
applying to images 288
control points 306, 35 1
controlling the output grid 297
forward transformation (mapping)
278
global transformations 306
homogeneous coordinates 284
horizon line 288
image coordinate systems 291
input space 278
interpolation 299
1 – D 299
2-D 302
bicubic 302
bilinear 302
comparing methods 302
cubic 302
kernels 300
linear 301
nearest-neighbor 302
resampling 300
local transformations 306
inverse transformation (mapping)
279, 288
output image location 293
output space 278
shape-preserving 285
projective transformations 287
tiles 107
vanishing points 288
get 56,353
getsequence 496
global 430
Gradient
defined 366
morphological 524
used for edge detection. See Image
segmentation
Graphical user interface (GUI) 353
g ray2ind 325
graycomatrix 648
graycoprops 649
Gray level. See also Intensity
definition 2, 1 3, 27
transformation function 81
grayslice 325
graythresh 562
grid off 1 91
grid on 191
gscale 92
H
HI line 45
Handle. See Function handle
help 46
hilb 39
Hilbert matrix 39
hist 220
histc 437
histeq 1 00
Histogram. See also Image
enhancement
bimodal 558
contrast-limited 107
defined 94
equalization 99
equalization of color images 359
matching 102
normalized 94
plotting 94
specification 102
unimodal 558
histroi 227
hold on 98
Hole. See also Morphology, Region
definition 598
filling 520
Hotelling transform 662
hough 553
Hough transform.See also Image
segmentation
accumulator cells 552
functions for computing 552
line detection 556
line linking 556
parameter space 551
houghlines 555
houghpeaks 555
hpfilter 195
hsi2rgb 338
hsv2rgb 330
huff2mat 440
huffman 429
hypot 187
Hysteresis thresholding. See Image
segmentation
i 55
i2percentile 567
ICC. See International Color
Consortium
color profiles 346
iccread 347
ice 352
Icon notation. See also Notation
custom function 7
MATLAB Wavelet Toolbox 377
Image Processing Toolbox 7
JDFT. See Inverse discrete Fourier
transform
if 58
IF-THEN rule. See Fuzzy processingifanbeam 272
ifft2 172
ifftshift 1 70
ifrdescp 629
Illumination bias 575
im2bw 29, 3 1
im2col 460
im2double 29
im2f rame 473
im2j peg 457
im2j peg2k 466
im2minperpoly 6 1 7
im2single 29
im2uint8 29
im2uint 1 6 29
imadj ust 82
imag 1 70
Image 2
amplitude 2
analysis 3
as a matrix 1 5
average power 241
binary 27, 598
classes 26
converting between 23
columns 1 4
coordinates 1 3
definition 2
description. See Representation
and description
digital 2, 1 4
displaying 1 8
dithering 323
element 2, 15
formal extensions 1 7
formats 1 7
gray level. See Gray level, Intensity
gray-scale 27
indexed 27
intensity. See Intensity
interpolation. See Geometric
transformations
monochrome 1 3
multispectral 666, 686
origin 1 4
padding 1 1 0, 1 1 8, 174
picture element 2
representation. See Representation
and description
resolution 24
RGB 1 3, 27
rows 1 4
size 14
spatial coordinates 2
Tool 1 9
types 27
understanding 3
writing 2 1
Image compression
background 421
coding redundancy 424
compression ratio 421
decoder 421
encoder 42 1
error rree 423
Huffman 427
code 427
block code 428
decodable 428
instantaneous 428
codes 427
decoding 439
encoding 433
improved gray-scale ( IGS)
quantization 453
information preserving 423
inverse mapper 424
irrelevant infomation 453
J PEG 2000 compression 464
coding system 464
subbands 464
J PEG compression
discrete cosine transform (OCT)
456
JPEG standard 456
lossless 423
lossless predictive coding 449
predictor 449
quantization 453
quantizer 424
reversible mappings 449
rms 423
root mean square error 423
spatial redundancy 446
interpixel redundancy 448
symbol coder 424
symbol decode 424
video compression 472
image sequences in MATLAB
473
motion compensation 476
movies in MATLAB 473
multiframe TIFF files 472
temporal redundancy 472, 476
video frames 472
Image enhancement 80, 1 64
color. See Color image processing
contrast enhancement, stretching
84, 85, 90, 529
frequency domain filtering 164
high-frequency emphasis 1 97
periodic noise removal 204
sharpening 1 94
smoothing 1 88
histogram
adaptive equalization 107
equalization 99
matching (specification) 102
processing 93
intensity transformations 81
arbitrary 86
contrast-stretching 84
functions for computing 82, 89
logarithmic 84
spatial filtering
geometric mean 1 19
noise reduction 1 27
sharpening 1 20
• Index 821
smoothing (blurring) 1 1 6
using fuzzy sets 1 55
Image Processing Toolbox I , 4, 7
Image reconstruction
absorption profile 252
background 252
backprojection 253, 259
center ray 268
computed tomography 251
fan-beam 259
fan-beam data 268
filter implementation 258
filtered projection 258
Fourier slice theorem 257
generalized delta functions 258
parallel-ray beam 255
Radon transform 254
Ram-Lak filter 259, 266
ray sum 254
Shepp-Logan filter 259
Shepp-Logan head phantom 261
sinogram 263
slice 254, 257
windowing functions. See
Windowing functions
Image registration
area-based 3 1 1
automatic registration 3 1 6
basic process 306
control points 306
correlation coefficient 3 1 2
reature detector 3 1 6
inferring transformation
parameters 307
inliers 3 1 7
manual feature selection 306
manual matching 306
mosaicking 3 1 6
normalized cross-correlation 3 1 2
outliers 3 1 7
similarity metrics 314
Image restoration
adaptive spatial filters 233. See
also Spatial filters
deconvolution 210
blind, 237, 250
direct inverse filtering 240
iterative 247
linear 210
Lucy-Richardson algorithm 246
model 2 1 0
noise models 2 1 1 . See also Noise
noise only 229
nonlinear 247
constrained least squares filtering
244
optical transfer function 210
parametric Wiener filter 241
periodic noise reduction 236
point spread function 2 1 0
pseudoinverse 240
spatial noise filters. See also Spatial
filters
regularized filtering 244822 • Index
Wiener riltering 240
Image segmentation
edge detection 541
Canny detector 546
double edges 542, 546
gradient angle 541
gradient magnitude 541
gradient vector 54 1
Laplacian 542
Laplacian of a Gaussian (LoG)
detector 545
location 542
masks 544
Prewitt detector 543, 545
Roberts detector 543, 545
Sobel detector 542
using function edge 541
zero crossings 543
zero-crossings detector 546
image thresholding
using local statistics 571
line detection 538
masks 538
using the Hough transform 549
nonmaximal suppression 546
oversegmentation 591
point detection 536
region-based 578
logical predicate 578
region growing 578
region splitting and merging 582
edge map 549
thresholding 557
background point 557
basic global thresholding 559
hysteresis 546
local statistics 571
object (foreground) point 557
Otsu’s (optimum) method 561
separability measure 562
types of 558
using edges 567
using image smoothing 565
using moving averages 575
using watersheds 588
catchment basin 588
marker-controlled 593
using gradients 591
using the distance transform 589
watershed 588
watershed transform 588
I mage Tool 1 9
imapprox 321
imbothat 529
imclearborder 52 1
imclose 501
imcomplement 83
imdilate 492
imerode 500
imextendedmin 595
imfilter 1 1 4
imf ill 52 1 . 603
imf info 23
imhist 94, 1 56
imhmin 53 1
imimposemin 595
imlincomb 50
imnoise 1 26, 2 1 1
imnoise2 2 1 6
imnoise3 221
imopen 50 1
implay 407, 474
implfcns 1 47
imratio 42 1
imread 1 5
imreconstruct 5 1 8
imregionalmin 593
imrotate 29 1 , 659
imshow 1 8, 69
imstack2vectors 663
imtool 1 9
imtophat 529
imt ransform 288
imt ransform2 298
imwrite 2 1
ind2gray 325
ind2rgb 326
ind2sub 40
Indexing 33
linear 39
logical 38
matrix 35
row-column 40
single colon 37
subscript 33
vector 33
Inf 47
I nitialMagnification 5 1 0
inpolygon 6 1 6
input 72
int2st r 699
intB 26
int 1 6 26
int32 26
Intensity. See also Gray level
definition 2, 13, 27
scaling 92
transformation function 8 1
arbitrary 86
contrast-stretching 84
fuzzy 1 55
histogram. See Histogram
logarithmic 84
thresholding 85
utility M-functions 87
transformations 80
International Color Consortium 346
I nterpolation. See Geometric
transformations
interp1 86
interp 1 q 35 1
interpn 1 53
intline 606
intrans 89, 1 57
invmoments 658
iptsetpref 291
iradon 263
iscell 54
iscellstr 54, 694
ischar 54
isempty 54
isequal 54
iseven 203
isfield 54
isfinite 54
isinf 54
isinteger 54
isletter 54
islogical 28, 54
ismember 54
isnan 54
isnumeric 54
isodd 203
isprime 54
isreal 54
isscalar 54
isspace 54
issparse 54
isst ruct 54
isvector 54
Inverse discrete Fourier transform
1 65
J
j 55
j peg2im 461
j peg2k2im 468
JPEG compression 456
L
Label matrix 5 1 5
lambdafcns 1 46
Laplacian
defined 1 20
mask for 1 2 1 . 122
of a Gaussian (LoG). See Image
segmentation
of color images 365
of vectors 365
used for edge detection. See Image
segmentation
Laplacian of a Gaussian (LoG) 545
LaTeX-style notation 553
length 59
Line
detection. See Image segmentation,
Hough transform
linking. See Hough transform
normal representation 551
slope-intercept representation 55 1
Linc detection. See Image
segmentation
linspace 34. 1 57
load 1 1
localmean 572
localthresh 573
log 84
log2 84
log 1 0 84
logical 26, 27Logical
array 27
class 27
indexing 38, 2 1 6
mask 125, 225. 587
operator 52
long 57
Long lines. See Code
long e 57
long eng 57
long g 57
lookfor 46
Lookup table 87, 506
lower 201
lpc2mat 45 1
lpfilter 1 89
Lucy-Richardson algorithm. See
Image restoration
M
magic 44
Magic square 44
mahalanobis 678
makecform 344
makecounter 1 4 1
makefuzzyedgesys 1 6 1
makelut 507
maketform 279
Mammogram 83
manualhist 105
Marker image 5 1 8, 567, 584, 593. See
also Morphology
Mask. See Logical mask, Spatial mask.
Morphological
reconstruction
mat2gray 29, 30
mat2huff 436
mat2str 699
Matching. See Recognition
MAT-file I I
MATLAB 1 , 2
background 4
command history 9
command window 8
coordinate convention 1 4
current directory 8
current directory field 8
definition 4
desktop 7
desktop tools 9
editor/debugger 1 0
Function Factories 1 4 1
function-generating functions 1 4 1
function plotting 93
help 10
help browser 10
image coordinate systems 29 1
M-file. See Function
M-function. See Function
nested Functions . See Function
plotting 1 90
prompt 1 6
retrieving work 1 1
saving work 1 1
search path 9
string operations 692
toolboxes 4
workspace 8
workspace browser 8
Matrix
as an image 1 5
interval. See Morphology
operations 47
sparse 42
vs. array 15
Matrix vs. array 1 5
max 48, 686
Maximum likelihood 250
mean 76, 5 1 7
mean2 76, 92
Mean vector 684
approximation 662
function for computing 663
medfilt2 1 26
Median 1 26. See also Spatial filtering,
Spatial filters
mesh 1 90
meshgrid 69
Metacharacters 695
mexErrMsgTxt 445
MEX-file 442
min 48
Minima imposition 595
Minimum-perimeter polygons 6 1 0,
703. See also
Representation and
description
Moire pattern 203
Moment(s)
about the mean 224
central 224
invariants 656
statistical 632
used for texture analysis 644
Monospace characters 1 5
montage 474
Morphology, Morphological
4-connectivity 5 1 5
8-connectivity 5 1 5
closing 500
combining dilation and erosion 500
connected component 5 1 4
definition 5 1 5
labeling 5 1 4
label matrix 5 1 5
dilation 490
erosion 497
filtering 503, 524, 526
gradient 524
gray-scale morphology
alternating sequential filtering
526
bottomhal transformation 529
close-open filtering 526
closing 524
dilation 52 1
erosion 521
• Index 823
granulometry 529
open-close filtering 526
opening 524
reconstruction 530
closing-by-reconstruction 531
h-minima transform 53 1
opening-by-reconstruction 531
tophat-by-reconstruction 532
surface area 529
tophat transformation 528
hit-or-miss transformation 503
interval matrix 506
lookup table 506
matching 503
opening 500
pruning 5 1 2
parasitic components 5 12
reconstruction 5 1 8
clearing border objects 521
filling holes 520
mask 5 1 8
marker 5 1 8
opening by reconstruction 5 1 8
reflection o f set 488
shrinking 5 1 2
skeleton 5 1 1
spurs 5 1 2
structuring element 486, 490
decomposition 493
Fial 522
origin 488, 491 , 492
st rel Function 494
thickening 51 2
thinning 5 1 1
translation or set 488
view of binary images 489
Mosaicking 3 1 6
movie2avi 475
movingthresh 576
movie2tifs 475
M PP. See Minimum-perimeter
polygons
mxArray 445
mxCalloc 445
mxCreate 445
mxGet 445
N
NaN 47, 55
nargchk 88
nargin 87
nargout 87
ndims 42
Neighborhood processing 80, 1 09
Nested function. See Function
nextpow2 1 75
nlfilt 1 1 7
Noise
adding 2 1 1
application areas 2 1 3
average power 241
density 2 1 5824 • Index
Erlang 2 1 4
parameter
estimating 224
scaling 2 1 1
exponential 2 1 4
filters. See Filter(ing)
gamma. See Erlang above
Gaussian 2 1 4
lognormal 2 1 4
models 2 1 1
multiplicative 2 1 1
periodic 220
Poisson 2 1 1 , 247
Rayleigh 2 1 2, 2 1 4
salt and pepper 2 1 4, 2 1 5
speckle 2 1 1
uniform 2 14
with specified distribution 2 1 2
Noise-to-signal power ratio 241
norm 675
Norm. See Vector norm
Normalized cross-correlation.
See Correlation
normxcorr2 3 1 3, 682
NOT 53
Notation
colon 33
function listing 7
icon 7
LaTeX-style 553
ntrop 426
ntsc2rgb 329
Number
exponential notation 56
floating point 55
format types 57
precision 55
representation 55
numel 59
0
Object recognition. See Recognition
onemf 1 46
ones 44
Operation
array 47
elementwise 47
matrix 47
Operator
arithmetic 46
logical 52
relational 50
OR 53
elementwise 53
scalar 53
ordfilt2 1 25
Ordering boundary points 605
OTF (optical transfer function) 2 1 0
otf2psf 2 1 0
otsuthresh 564
p
padarray 1 1 8
paddedsize 1 74
Padding. See Image padding
Panning 604
para2fan 275
patch 320
Pattern recognition. See Recognition
PDF. See probability density function
Pel 2, 1 5. See also Pixel
Percentile 567
percentile2i 567
permute 677
persistent 507
phantom 261
pi 55
Picture element 2, 1 5
Pixel
coordinates 1 4
definition 2, 1 5
pixeldup 238
Pixel(s)
adjacent 5 1 5
connected 5 1 5. 597
connecting 605
ordering along a boundary 605
path 5 1 5
straight digital line between two
points 606
Pixels(s)
orientation or triplets 6 1 2
plot 4 1 , 98
Plotting 93, 98
surface 190
wireframe 1 90
Point detection. See Image
segmentation
pointgrid 282
pol2cart 621
polyangles 704
Polymersome cells 563
pow2 438
Preallocating arrays 65. See also
Code
Predicate
function 585
logical 578
Predicate (logical) 578
Principal components
for data compression 667
for object alignment 670
transform 662
principalcomps 664
print 26
Probability. See also Histogram
density function 99
for equalization 99
specified 1 03
table or 2 1 4
of intensity level 94
prod 1 1 9
Programming. See also Code,
Function
break 61
code optimization 65
commenting code 45
continue 58. 6 1
floating-point numbers 55
flow control 57
function body 45
function definition line 45
H I line 45
help text 45
if construct 58
interactive 1/0 7 1
M-Function 44
loops 59, 60
number formats 57
operators 46
switch 62
values 55
variable number of inputs and
outputs 87
vectorizing 68
wrapper function 298
Prompt 8
PSF (point spread function) 210
psf2otf 210
Q
qtdecomp 584
qtgetblk 584
quad 64
Quadimages 583
Quadregions 583
Quadtree 583
Quantization 1 4
quantize 454
R
radon 260
Radon transform 254
rand 44, 2 1 5
randn 44. 2 1 5
Random
variable 2 1 1 . 224
number generator 2 1 3
randvertex 704
RANSAC 3 1 6
real 1 70
realmax 55
realmin 55
Recognition
decision boundary 679
decision function 679
decision-theoretic methods 679
adaptive learning systems 691
Bayes classifier 684
correlation 68 1
correlation template 681
minimum-distance classifiers 680
discriminant function 679
distance measures 675
feature 674hyperplane 681
matching. See also Crosscorrelation
correlation 681
minimum-distance 680
morphological. See Morphology
template 312, 681
pattern 674
pattern class 674
pattern vector 674, 680
structural methods 691
regular expressions 694
string matching 693, 701
string registration 701 , 704
working with pattern strings in
MATLAB 692
reflect 492
regexp 695
regexpi 696
regexprep 696
Region
adjacent 578
background points 598
border 598
boundary 598
contour 598
functions for extracting 598
interior point 59, 598
of interest 225
Regional descriptors.
See Representation and
description
regiongrow 580
Region growing. See Image
segmentation
Region merging. See Image
segmentation
regionprops 642
Region splitting. See Image
segmentation
Regular expressions 694
rem 1 52, 392
Representation and description
background 597
description approaches 625
boundary descriptors 625
axis (major, minor) 626
basic rectangle 626
corners 633
curvature 703
diameter 626
Fourier descriptors 627
length 625
shape numbers 626
statistical moments 632
regional descriptors
co-occurrence matrices 647
function regionprops 642
moment invariants 656
principal components 661
texture 644
region and boundary extraction
598
representation approaches
boundary segments 622
chain codes 606
Freeman chain codes 606
normalizing 606
minimum-perimeter polygons
610, 703
normalizing chain codes 606
signatures 6 1 9
reprotate 303
Resampling 300
reshape 401, 438
Resolution. See I mage
return 58
rgb2gray 326
rgb2hsi 337
rgb2hsv 330
rgb2ind 325
rgb2ntsc 328
rgb2ycbcr 329
rgbcube 320
Ringing 1 87, 242
ROI. See Region of interest
roipoly 225
rot90 1 1 5
round 25
Row vector. See Vector
s
Sampling
definition 1 4
save 1 1
Scalar 1 5
Scripts 44
Scrolling 604
seq2t i f s 475
set 96
Set
element 128
fuzzy. See Fuzzy processing
theory 128
shading interp 1 93
Shape 597, 621 , 623, 626. See also
Representation and
description
short 57
short e 57
short eng 57
short g 57
showmo 483
Sifting 1 1 2, 255
sigmamf 144, 1 56
signature 620
Signatures 6 1 9
single 26
Singleton dimension 1 7
size 1 6
Skeleton 623
medial axis transformation 623
morphological 623
smf 144
Soft proofing 347
sort 431
sort rows 604
sparse 42
Sparse matrix 42
Spatial
• Index 825
convolution. See Convolution
coordinates 1 3
correlation. See Correlation
domain 80, 1 65
filter. See Spatial filters
kernel 1 10
mask 1 1 0, 681
neighborhood 8 1
template 1 1 0, 3 1 1 , 681
Spatial filtering 109
fuzzy 1 58
linear 109, 1 1 4
mechanics 1 10
morphological. See Morphology
nonlinear 1 17, 1 24
of color images 360
Spatial filters. See also Spatial
filtering
adaptive 233
adaptive median 233
alpha-trimmed mean 230
arithmetic mean 230
average 1 2 1
contraharmonic mean 230
converting to frequency domain
filters 1 8 1
disk 1 2 1
gaussian 1 21
geometric mean 230
harmonic mean 230
iterative nonlinear 246
laplacian 1 2 1 , 1 22. See
also Laplacian
linear 1 20
log 1 2 1
max 126, 230
median 126, 230
midpoint 230
min 1 26, 230
motion 1 2 1
morphological. See Morphology
noise 229
order statistic 1 24. See also
ordfilt2
prewitt 121
rank 124.See also ordfilt2
sobel 121
unsharp 121
Spectrum. See Fourier spectrum
specxtu re 655
spfilt 229
spline 352
splitmerge 585
sprintf 60
sqrt 64
Square brackets 30, 33, 35, 45
statmoments 225
statxtu re 645
stdf il t 572
stem 96
st rcat 696826 • lndex
strcmp 73, 697
st rcmpi 74, 400, 454, 697
strel 494
Strings. See Recognition
strel object 496
stretchlim 84
strfind 698
strj ust 698
st rncmp 697
st rncmpi 698
strread 73
strrep 698
st rsimilarity 701
strtok 699
Structure 74
example 77
fields 77
variable 23
Structuring element. See Morphology
strvcat 697
sub2ind 40
subplot 384
Subscript 33
sum 37
surf 1 93
switch 58, 62
T
Template matching. See Recognition
text 96
Texture. See also Regional descriptors
spectral measures of 654
statistical approaches 644
tform structure 279, 345
tofloat 32
tformfwd 28 1
tforminv 281
tform structure 279
THEN 1 56
Thresholding. See Image
segmentation
tic 65
t if s2cv 480
t if s2movie 475
tif s2seq 475
timeit 66
title 96
toe 65
Transfer function. See Frequency
domain filters
Transformation function. See
Intensity
t ranspose 33
trapezmf 1 43
triangmf 1 43, 1 56
true 44, 587
truncgaussmf 1 45
t ry . . . catch 58
twomodegauss 1 04
Types. See Image types
u
uinte 26
uint 1 6 26
uint32 26
unique 604
unrave l . c 443
unravel . m 444
Until stability 5 1 1
upper 201
v
varargin 88
varargout 88
Vector
column 1 3, 1 5
norm 245, 675
row 1 3, 1 5
v e r 55
version 55
Vertex
adding noise to 704
concave 6 1 2
convex 6 1 2
o f minimum-perimeter polygon
6 1 2
view 1 9 1
Vision 2
computer 3
high-level 3
human 3
low-level 3
mid-level 3
visreg 309
vistform 283
visualizing aligned images 308
w
waitbar 1 5 1
watershed 590
Watersheds. See Image segmentation
waveback 409
wavecopy 402
wavecut 401
wavedec2 385
wavedisplay 404
wavefast 391
wavefilter 388
wavefun 382
waveinfo 382
Wavelets
approximation coefficients 381
background 377
custom function 394
decomposition coefficients 404
displaying 404
editing 399
decomposition structures 396
downsampling 380
expansion coefficients 378
FWTs using MATLAB’s Wavelet
Toolbox 38 1
FWTs without the Wavelet Toolbox
387
Haar 383
scaling function 383
wavelet function 385
wavelet functions 383
highpass decomposition filler 380
image processing 4 1 4
edge detection 4 1 4
progressive reconstruction 4 1 7
smoothing 4 1 5
inverse fast wavelet transform 408
kernel 378
lowpass decomposition filter 380
mother wavelet 379
properties 379
scaling 380
scaling function 379
support 384
transform domain variables 377
wavepaste 403
waverec2 409
wavework 399
wavezero 4 1 5
wfilters 381
while 58, 60
whitebg 322
whos 1 7
Windowing functions
cosine 259
Hamming 259
Hann 259
Ram-Lak 259
Shep-Logan 259
sine 259
Wraparound error. See Discrete
Fourier transform
wthcoef2 398
x
x2maj oraxis 627
xlabel 96
xlim 98
xtick 96
y
ycbr2rgb 329
ylabel 96
ylim 98
ytick 96
z
zeromf 1 45
zero s 44
z
Zero-phase-shift filters. See
Frequency domain fillers
كلمة سر فك الضغط : books-world.net
The Unzip Password : books-world.net
تحميل
يجب عليك التسجيل في الموقع لكي تتمكن من التحميل
تسجيل | تسجيل الدخول