Algorithms for Image Processing and Computer

1 downloads 0 Views 3MB Size Report
OpenCV. The Basic OpenCV Code. The Ipllmage Data Structure. Reading and Writing Images. Image Display. An Example. Image Capture. Interfacing with the ...
Algorithms for Image Processing and Computer Vision Second Edition

J.R. Parker

WILEY

Wiley Publishing, Inc.

Contents

Preface Chapter 1

xxi Practical Aspects of a Vision System — Image Display,

Input/Output, and Library Calls OpenCV The Basic OpenCV Code The Ipllmage Data Structure Reading and Writing Images Image Display An Example Image Capture Interfacing with the AIPCV Library Website Files References

Edge-Detection Techniques The Purpose of Edge Detection Traditional Approaches and Theory Models of Edges Noise Derivative Operators Template-Based Edge Detection Edge Models: The Marr-Hildreth Edge Detector The Canny Edge Detector The Shen-Castan (ISEF) Edge Detector A Comparison of Two Optimal Edge Detectors

1 2 2 3 6 7 7 10 14 18 18 21 21 23 24 26 30 36 39 42 48 51

xiv

Contents Color Edges Source Code for the Marr-Hildreth Edge Detector Source Code for the Canny Edge Detector Source Code for the Shen-Castan Edge Detector Website Files References Chapter 3

Chapter 4

53 58 62 70 80 82

Digital Morphology Morphology Defined Connectedness Elements of Digital Morphology — Binary Operations Binary Dilation Implementing Binary Dilation Binary Erosion Implementation of Binary Erosion Opening and Closing MAX — A High-Level Programming Language for Morphology The "Hit-and-Miss" Transform Identifying Region Boundaries Conditional Dilation Counting Regions Grey-Level Morphology Opening and Closing Smoothing Gradient Segmentation of Textures Size Distribution of Objects Color Morphology Website Files References

107 113 116 116 119 121 123 126 128 129 130 131 132 135

Grey-Level Segmentation Basics of Grey-Level Segmentation Using Edge Pixels Iterative Selection The Method of Grey-Level Histograms Using Entropy Fuzzy Sets Minimum Error Thresholding Sample Results From Single Threshold Selection

137 137 139 140 141 142 146 148 149

85 85 86 87 88 92 94 100 101

Contents The Use of Regional Thresholds Chow and Kaneko Modeling Illumination Using Edges Implementation and Results Comparisons Relaxation Methods Moving Averages Cluster-Based Thresholds Multiple Thresholds Website Files References

151 152 156 159 160 161 167 170 171 172 173

Chapter 5

Texture and Color Texture and Segmentation A Simple Analysis of Texture in Grey-Level Images Grey-Level Co-Occurrence Maximum Probability Moments Contrast Homogeneity Entropy Results from the GLCM Descriptors Speeding Up the Texture Operators Edges and Texture Energy and Texture Surfaces and Texture Vector Dispersion Surface Curvature Fractal Dimension Color Segmentation Color Textures Website Files References

177 177 179 182 185 185 185 185 186 186 186 188 191 193 193 195 198 201 205 205 206

Chapter 6

Thinning What Is a Skeleton? The Medial Axis Transform Iterative Morphological Methods The Use of Contours Choi/Lam/Siu Algorithm Treating the Object as a Polygon Triangulation Methods

209 209 210 212 221 224 226 227

xv

xvi

Contents

Chapter 7

Chapter 8

Force-Based Thinning Definitions Use of a Force Field Subpixel Skeletons Source Code for Zhang-Suen/Stentiford/Holt Combined Algorithm Website Files References

228 229 230 234 235 246 247

Image Restoration Image Degradations — The Real World The Frequency Domain The Fourier Transform The Fast Fourier Transform The Inverse Fourier Transform Two-Dimensional Fourier Transforms Fourier Transforms in OpenCV Creating Artificial Blur The Inverse Filter The Wiener Filter Structured Noise Motion Blur — A Special Case The Homomorphic Filter — Illumination Frequency Filters in General Isolating Illumination Effects Website Files References

251 251 253 254 256 260 260 262 264 270 271 273 276 277 278 280 281 283

Classification

285

Objects, Patterns, and Statistics Features and Regions Training and Testing Variation: In-Class and Out-Class Minimum Distance Classifiers Distance Metrics Distances Between Features Cross Validation Support Vector Machines Multiple Classifiers — Ensembles Merging Multiple Methods Merging Type 1 Responses Evaluation Converting Between Response Types

285 288 292 295 299 300 302 304 306 309 309 310 311 312

Contents

Chapter 9

Merging Type 2 Responses Merging Type 3 Responses Bagging and Boosting Bagging Boosting Website Files References

313 315 315 315 316 317 318

Symbol Recognition

321 321 322 326 327 329 333 337 339 340 345 348 349 353 357 363 364 368 372

The Problem OCR on Simple Perfect Images OCR on Scanned Images — Segmentation Noise Isolating Individual Glyphs Matching Templates Statistical Recognition OCR on Fax Images — Printed Characters Orientation — Skew Detection The Use of Edges Handprinted Characters Properties of the Character Outline Convex Deficiencies Vector Templates Neural Nets A Simple Neural Net A Backpropagation Net for Digit Recognition The Use of Multiple Classifiers Merging Multiple Methods Results From the Multiple Classifier Printed Music Recognition — A Study Staff Lines Segmentation Music Symbol Recognition Source Code for Neural Net Recognition System Website Files References

Chapter 10 Content-Based Search — Finding Images by Example Searching Images Maintaining Collections of Images Features for Query by Example Color Image Features Mean Color Color Quad Tree

372 375 375 376 378 381 383 390 392 395 395 396 399 399 400 400

xvii

xviii Contents Hue and Intensity Histograms Comparing Histograms Requantization Results from Simple Color Features Other Color-Based Methods Grey-Level Image Features Grey Histograms Grey Sigma — Moments Edge Density — Boundaries Between Objects Edge Direction Boolean Edge Density Spatial Considerations Overall Regions Rectangular Regions Angular Regions Circular Regions Hybrid Regions Test of Spatial Sampling Additional Considerations Texture Objects, Contours, Boundaries Data Sets Website Files References Systems Chapter 1T High-Performance Computing for Vision and Image Processing Paradigms for Multiple-Processor Computation Shared Memory Message Passing Execution Timing Using clocW Using QueryPerformanceCounter The Message-Passing Interface System Installing MPI Using MPI Inter-Process Communication Running MPI Programs Real Image Computations Using a Computer Network — Cluster Computing

401 402 403 404 407 408 409 409 409 410 410 411 411 412 412 414 414 414 417 418 418 418 419 420 424 425 426 426 427 427 428 430 432 432 433 434 436 437 440

Contents A Shared Memory System — Using the PC Graphics Processor GLSL OpenGL Fundamentals Practical Textures in OpenGL Shader Programming Basics Vertex and Fragment Shaders Required GLSL Initializations Reading and Converting the Image Passing Parameters to Shader Programs Putting It All Together Speedup Using the GPU Developing and Testing Shader Code Finding the Needed Software Website Files References Index

444 444 445 448 451 452 453 454 456 457 459 459 460 461 461 465

xix

Suggest Documents