guide to signals and patterns in image processing - …978-3-319-14172-5/1.pdf · guide to signals...

20
Guide to Signals and Patterns in Image Processing

Upload: leduong

Post on 10-Apr-2018

217 views

Category:

Documents


2 download

TRANSCRIPT

Guide to Signals and Patterns in Image Processing

Apurba Das

Guide to Signals and Patterns in Image Processing

Foundations, Methods and Applications

1 3

ISBN 978-3-319-14171-8 ISBN 978-3-319-14172-5 (eBook)DOI 10.1007/978-3-319-14172-5

Library of Congress Control Number: 2014957492

Springer Cham Heidelberg New York Dordrecht London© Springer International Publishing Switzerland 2015This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, express or implied, with respect to the material contained herein or for any errors or omissions that may have been made.

Printed on acid-free paper

Springer is part of Springer Science+Business Media (www.springer.com)

Apurba DasTechnical Specialist, Image ProcessingEngineering and R&D,HCL Technologies Ltd., Chennai, India

Formerly,Scientist, Image Processing Lab.,CDAC, Kolkata, IndiaDepartment of Ministry of Communication and IT, Government of India e-mail: [email protected]

v

ToAngana

vii

Preface

We, humans, generally called as Homo sapiens, are the most superior species in the globe. Probably the most complex part of human body is the vision system which is the combination of the two eyes, the brain, and perception. Our vision system is probably the most accurate sensor among the other five, to create an illustration of the nature around us onto our brain in terms of perception. Hence the eye rather the entire vision system is not only one image-capturing device like a camera, but also a complex processing device of the captured image. The processing includes detec-tion, identification, recognition, analysis, synthesis, and modeling.

In today’s digital world, everything including some abstract concepts like emo-tions is expressed in terms of digital logic. The basic rule of digitization is finiteness and discreteness in the expression of any kind of data. The natural image can have infinite number of shades against each of the infinite number of colors. The varia-tion of color along the space is also continuous and the precision of change of inten-sity in natural image might be infinitesimally small. Hence, in digital representation of image we must have to go for some kind of approximation in terms of primary colors, spatial samples, and quantized intensities.

Any system, whether a computing system or psycho-visual system, infers imag-es in terms of a highly correlated signal. The aforementioned correlation is not nec-essarily neighborhood spatial correlation always. There can be a correlation in an image in terms of a repetitive texture, frequency component, shape, template, and many more. For any kind of object recognition from captured image we generally see that image from two different angles namely, local texture and holistic pattern.

This book illustrates the subject digital image processing from two different viewpoints. The first viewpoint is the signal processing perspective where each of the separation (primary color) of the image can be expressed as a two-dimensional (2D) matrix of discrete points representing intensities. These intensities must fol-low the aforementioned rule of digitization having finite upper limit, lower limit, and minimum step between adjacent levels. The second viewpoint is the pattern perspective where we discuss identification/selection, extraction, and reduction of suitable features from images, based on different applications and domains. Hence, the primary motivation of this book is to illustrate the wonderful subject of digital image processing from two different perspectives namely, signal processing and pattern recognition. The guide to the journey through the discipline of image pro-cessing would be “signals” and “patterns”. Wayne Wheeler, Sr. Editor of Springer,

viii Preface

UK has proposed the title of this book as “Guides to Signals and Patterns in Image Processing—Foundations, Methods and Applications”. I believe this is the most ap-propriate title depicting the motivation of this text.

Even though the subject digital image processing has been evolved through years and requires background of mathematics, physics, computer science, statistics, and information theory, I have tried to describe the concepts in a lucid way. Wherever signal processing or background of statistics or information theory is required, I have mentioned the prerequisites briefly at the beginning of the chapter or as an ap-pendix. Like all my other books, specially the last two books published by Springer, I started the chapters considering almost zero prerequisite and discussed the ap-plication levels and research scope in that particular area in depth after introducing the chapter of interest formally. Hence I believe this book would not only be a good text and reference book on image processing, but also a good teaching material for the teachers.

The chapter on the “Introduction to Digital Image” starts with formation of im-ages in nature. Any naturally formed image is an analog image. The principle of pin-hole camera is discussed to illustrate the theory of image formation. Next, the concept of digital image has been described in terms of sampling (to ensure the number of samples in a defined space to be finite) and quantization (to ensure num-ber of intensity levels to be finite). The concept of formation of picture element (or pixel) has been described. The basic geometric transformations are discussed here. Finally, the two basic operations of image processing, convolution and correlation are discussed along with suitable applications.

The second chapter “Image Enhancement in Spatial Domain” discusses differ-ent intensity transformations and image enhancement techniques in spatial domain. The histogram equalization technique is depicted in terms of an algorithm through which we get an enhanced image with improved information content. Here the con-cept of information theory (entropy) is discussed briefly as a prerequisite. The inter-polation techniques are also discussed to be used for image resampling and quality improvement of geometrically transformed images.

It is comparatively easier to understand the concept of frequency and phase in time domain representation of single dimensional signal than that of a spatial repre-sentation of a two-dimensional image. It is really difficult to realize frequency and phase from a given image without understanding the concepts physically. I have tried to hit that area in the chapter of “Interpretation and Processing of Image in Frequency Domain”.

The fourth chapter “Color Science and Color Technology” starts with the physics of light. Different kinds of devices are described from the color perspective. A num-ber of device dependent and independent color spaces and models are discussed along with their mathematical interrelations and applicability. The psycho-visual color system and its inclusion in CIE based color model are also described. The concept of halftone screening and color management are also discussed mentioning the industry and research scopes.

Understanding of the concept of frequency in images has been walked forward through the next chapter “Wavelets: Multi-resolution Image Processing”. Here we have described the method and idea of wavelet decomposition in detail. The dis-

ixPreface

crete wavelet transform and its applications in image enhancement and image com-pression have been described.

The sixth chapter “Compression and Encoding of Image: Image Formats” is es-pecially important for any kind of application development in image processing. The lossless and lossy compression methodology with trade-off has been described in the first half of this chapter. Second half of the chapter describes the process and algorithm of encoding the raw and compressed image formats. We have presented one C++ code for reading 24-bit BMP image. The code is available in the supple-mentary electronic material (CD) also. The two popular compressed image formats, JPEG and GIF are also discussed and the required code snippets are presented.

The seventh chapter “Morphology-Based Image Processing” is the bridge be-tween the signal and pattern perspective of image processing. Processing binary images with respect to their shape through basic set theory-based operations have been presented in this chapter. Next, a number of applications of basic morphology-based image processing, like erosion, dilation, opening, closing, pruning, filling, and skeletonization are presented.

The eighth chapter “Patterns in Images and its Applications” formally defines the pattern and feature. Next the method of feature extraction, selection, and reduction are presented. We have described many state-of-the-art applications against each of the pattern recognition techniques discussed in this chapter.

The ninth chapter “Psycho-visual Pattern Recognition: Computer Vision” de-scribes the vision system of human brain in terms of object recognition. The three-level image processing by visual cortex has been modeled through 2D signal pro-cessing filters. The response of different illusions to our vision system is studied and 2D filters generating equivalent responses are synthesized. The designed filter next has been used in computerized image enhancement and recognition of objects through patterns in images.

Salient Features

1. The subject is introduced from the very basic understanding of analog and digital image and the entire gamut is explored in an elegant way.

2. The application areas included in this volume are rich and state-of-art trend of industry and fundamental research.

3. Supplementary electronic material for this book is available from http://www.springer.com/978-3-319-14171-8 which includes a number of codes in MATLAB and C++, with uncommon and common applications for better understanding of the subject.

4. A couple of power point presentation materials are included in the supplementary electronic material (http://www.springer.com/978-3-319-14171-8) which would be useful for the teachers to present the abstract concepts like color and fre-quency in images through slides, as and when required.

5. Two GUI-based modules have also been supplied with the other supplementary electronic materials. The first one is Fourier Synthesis module (Version 1.1) to

x Preface

illustrate the synthesized waveform by tuning the amplitudes of the sine and cosine Fourier coefficients. The second one is image crop tool from 4-plane (CMYK) tiff image and creating images of different primary color separations with respect to selected region in the image. Readers can play with the tools for better understanding of the subject.

6. Elegant worked out numerical problems are designed in such a way that, the readers can get the flavor of the subject and get attracted towards the future scopes of research and development in the domain of signal processing, image processing, and pattern recognition.

7. Depending on the relationship and interdependencies between the nine chapters and three appendices, two distinct study flows are presented. Readers can choose their appropriate study flow according to their areas of interest, understanding the interdependencies.

This volume is intended to fulfill the expectations of students as well as the teachers. I hope this book is not only a favorite study material for the students but also a nice resource for teaching. In my career, I have been engaged in full-time teaching, faculty upgradation training, and served both government R&D and hardcore private industry. Therefore I can feel the requirements of each and every sector closely. I expect detailed feedback from the readers of this book. My sincere efforts would be successful, if this volume meets the requirements and expectations of all the students, teachers, researchers, and professionals in the domain of image processing and pattern recognition.

12th September, [email protected]

xi

Acknowledgements

My parents Sri. Barun Das and Smt. Nabanita DasMy teacher Prof. Amit KonarMy students All my direct and indirect students whom I could give direc-

tion towards at least a small glimpse of the light, the light of knowledge

My colleagues from HCL, Xerox, CDAC and NIT

Mr. Manoj PainMr. Bagavath S.Mr. Sankaralingam S.Mrs. Krishna Das MazumdarMr. Debasis MazumdarDr. Bapu K. B.Dr. Sainarayanan G.Mr. Nagarajan N.Ms. Ranita BejMs. Kavitha S.Ms. Puja Bahuguna SinhaMs. Arathi IsacMr. Farzin BlurfrushanMr. Eric BarnesMr. David RumphMr. Gregory WidenerMr. Jay GlaspyMr. Andrew PostDr. Edul Dalal…and many more…

My friends All my friends who liked me, loved me, hated me but did not ignore meAll my critics

The team Springer Mr. Alfred HofmannMr. Wayne WheelerMr. Simon Rees

xiii

Depending on the relationships and interdependencies between the nine chapters and three appendices, three distinct study flows are presented. It is now up to the readers to choose the most suitable and convenient study flow according to their field of interest.

The Flow of Study

xiv The Flow of Study

xvThe Flow of Study

xvii

Contents

1 Introduction to Digital Image ................................................................... 11.1 Formation of an Image ....................................................................... 11.2 Definition of Signal ............................................................................ 31.3 Analog and Digital Image as 2D Signal ............................................. 6

1.3.1 Continuous Time Continuous Valued Electrical Signal ......... 71.3.2 Continuous Space Continuous Intensity (CSCI) Image ......... 71.3.3 Sampling: Discrete Time Continuous Valued (DTCV)

Electrical Signal ..................................................................... 81.3.4 Concept of Sampling in Images (2D Signal) ......................... 91.3.5 Quantization: Discrete Time Discrete Valued (DTDV)

Electrical Signal ..................................................................... 101.3.6 Quantization in Images (2D Signal) ...................................... 121.3.7 Encoding in Images (2D Signal) ............................................ 14

1.4 Relationships Between Pixels ............................................................ 141.4.1 Neighborhood ........................................................................ 141.4.2 Adjacency ............................................................................... 161.4.3 Distance Measures ................................................................. 16

1.5 Geometric Transformations ............................................................... 181.5.1 Translation .............................................................................. 181.5.2 Scaling .................................................................................... 211.5.3 Rotation .................................................................................. 221.5.4 Homogeneous Transformation ............................................... 251.5.5 Concatenation of Transformation .......................................... 271.5.6 Affine Transformation ............................................................ 30

1.6 Convolution ........................................................................................ 311.6.1 Transformed Domain Simplicity ............................................ 331.6.2 2D Convolution: Convolution in Image Processing .............. 35

1.7 Correlation ......................................................................................... 361.7.1 Case Study: Pattern (Shape Feature) Matching Between

Two Objects Using Cross-Correlation ................................... 37

xviii Contents

1.8 MATLAB Codes ................................................................................ 401.8.1 Sampling of a Sweep Image .................................................. 401.8.2 Resolution of Image ............................................................... 401.8.3 Quantization of Image ............................................................ 411.8.4 Correlation Subroutine ........................................................... 42

Reference .................................................................................................... 42

2 Image Enhancement in Spatial Domain .................................................. 432.1 Intensity Transformations .................................................................. 44

2.1.1 Linear Transformation ........................................................... 442.1.2 Contrast Stretching and Thresholding .................................... 462.1.3 Negative Intensity Transform ................................................ 462.1.4 Logarithmic Intensity Transformation ................................... 462.1.5 Power-Law Intensity Transform and Gamma Correction ...... 47

2.2 Histogram of an Image ....................................................................... 492.2.1 Skewness ................................................................................ 512.2.2 Kurtosis .................................................................................. 51

2.3 Histogram Equalization and Histogram Specification ....................... 522.4 Image Smoothing ............................................................................... 58

2.4.1 Mean Filter ............................................................................. 582.4.2 Ordered Statistics Filter ......................................................... 61

2.5 Image Sharpening .............................................................................. 632.5.1 Image Sharpening by Gradient Mask: First-Order

Derivative ............................................................................... 652.5.2 Image Sharpening by Laplacian mask: Second-Order

Derivative ............................................................................... 672.6 Image Interpolation and Resampling ................................................. 68

2.6.1 B-Spline Function .................................................................. 722.6.2 Interpolation of 1D Signal by B-Spline ................................. 742.6.3 Interpolation of 2D Image ...................................................... 80

2.7 MATLAB codes ................................................................................. 882.7.1 Image Transformation Without Interpolation ........................ 882.7.2 Image Rotation with Different Interpolation Techniques ...... 892.7.3 Mean and Median Filter Response on Noisy Image .............. 902.7.4 Image Sharpening by Laplacian Mask ................................... 91

Reference .................................................................................................... 91

3 Interpretation and Processing of Image in Frequency Domain ............. 933.1 Concept of Frequency in Image ......................................................... 94

3.1.1 Fourier Series ......................................................................... 943.1.2 Interpretation and Direction of Frequency in Image .............. 99

3.2 Phase Congruency and Edge Detection in an Image ......................... 1003.3 Fourier Transform for Continuous and Discrete Time Signals .......... 106

3.3.1 Discrete Time Fourier Transform ........................................... 1073.3.2 DFT and FFT ......................................................................... 109

3.4 DFT of Digital Image ......................................................................... 110

xixContents

3.5 Translation and Scaling Properties of 2D Fourier Transform ............ 1123.5.1 Translation: Dragging the LF (DC) Component at the

Center of the 2D Spectra ........................................................ 1123.5.2 Scaling: Space-Frequency Relationship in Image ................. 114

3.6 Concept of Image Filtering in Frequency Domain ............................ 1203.7 Smoothing Filter ................................................................................ 124

3.7.1 Ideal LPF ................................................................................ 1253.7.2 Butterworth LPF .................................................................... 1263.7.3 Gaussian LPF ......................................................................... 129

3.8 Sharpening Filter ................................................................................ 1303.8.1 Ideal HPF ............................................................................... 1323.8.2 Butterworth HPF .................................................................... 1333.8.3 Gaussian HPF ......................................................................... 135

3.9 Case Studies ....................................................................................... 1363.9.1 Importance of Phase over Amplitude in DFT Spectrum ........ 1363.9.2 DFT over DFT ....................................................................... 138

3.10 Matlab Codes ................................................................................... 1433.10.1 Ideal 2D Filters in Frequency Domain ................................. 1433.10.2 Subroutine of 2D Butterworth Filter .................................... 1453.10.3 Subroutine of 2D Gaussian Filter ........................................ 1453.10.4 Importance of Phase over Amplitude in Image Spectrum ... 146

References ................................................................................................... 147

4 Color Science and Color Technology ........................................................ 1494.1 Light and Primary Colors ................................................................... 149

4.1.1 Device-Dependent Primary Colors: Additive Color Model ... 1514.1.2 Device-Dependent Primary Colors: Subtractive Color

Model ..................................................................................... 1524.1.3 Reflectance and Its Spectra .................................................... 154

4.2 Psycho-Visual Color: Human Vision System .................................... 1584.2.1 Photoreceptors: Rods and Cones ........................................... 158

4.3 Color Description Systems ................................................................ 1614.3.1 Munsell System ...................................................................... 1624.3.2 Pantone System ...................................................................... 163

4.4 Colorimetry: CIE Standards ............................................................... 1664.4.1 CIE Standard Illuminant ........................................................ 1674.4.2 CIE Standard Observer .......................................................... 169

4.5 CIE Color Spaces ............................................................................... 1704.5.1 Non-uniform Perceptual Color Spaces .................................. 1714.5.2 Uniform Perceptual Color Spaces .......................................... 1744.5.3 Xerox/YES Color Space ........................................................ 176

4.6 Halftone Screening ............................................................................. 1774.6.1 Moire Pattern and Screen Angle ............................................ 1784.6.2 Growth Sequence of Halftone Dot ......................................... 179

xx Contents

4.7 Color Management ............................................................................. 1814.7.1 Profile Connection Space (PCS) ............................................ 1844.7.2 Gamut Mapping ..................................................................... 1844.7.3 Rendering Intents ................................................................... 185

4.8 Matlab Codes ..................................................................................... 1894.8.1 Halftone Screening by Error Diffusion .................................. 1894.8.2 Error Diffusion Subroutine .................................................... 190

Reference .................................................................................................... 190

5 Wavelets: Multiresolution Image Processing ........................................... 1915.1 Introduction ........................................................................................ 1915.2 Short-Time Fourier Transform ........................................................... 191

5.2.1 Continuous-time STFT .......................................................... 1945.2.2 Discrete-time STFT ................................................................ 1945.2.3 Spectrogram ........................................................................... 1945.2.4 Limitation ............................................................................... 195

5.3 Wavelet Function and Scaling Function ............................................ 1965.4 Wavelet Series .................................................................................... 2025.5 Discrete Wavelet Transform and Multiresolution analysis ................ 203

5.5.1 Analysis Filter Bank ............................................................... 2055.5.2 Synthesis Filter Bank ............................................................. 206

5.6 Image Decomposition Using DWT .................................................... 2075.6.1 Concept of 2D Signal Decomposition Using Analysis

Filter ....................................................................................... 2075.6.2 DWT on Images (Fig. 5.16) ................................................... 208

5.7 Image Compression Using DWT: EZW Encoding ............................ 2105.7.1 Relationship Between Decomposed Sub-bands ..................... 2115.7.2 Successive Approximation Quantization in EZW ................. 2125.7.3 EZW Encoding Algorithm ..................................................... 2135.7.4 Image Compression using EZW: An Example ...................... 2145.7.5 Experimental Results of Image Compression Using EZW .... 216

5.8 MATLAB Programs ........................................................................... 2185.8.1 Haar Scaling and Wavelet Function ....................................... 2185.8.2 Wavelet Series Expansion ...................................................... 2195.8.3 Wavelet Decomposition of Image (4 level) ........................... 2205.8.4 Image Compression by EZW Encoding ................................. 221

References ................................................................................................... 221

6 Compression and Encoding of Image: Image Formats .......................... 2236.1 Redundancy: Fundamentals of Compression ..................................... 2246.2 Entropy: The Measure of Information ............................................... 2266.3 Entropy Coding .................................................................................. 227

6.3.1 Shannon–Fano Coding ........................................................... 2286.3.2 Huffman Coding .................................................................... 229

6.4 Lossy Compression ............................................................................ 2306.4.1 Block Truncation Compression (BTC) .................................. 2306.4.2 Vector Quantization Compression (VQC) ............................. 233

xxiContents

6.5 Lossless Compression ........................................................................ 2366.5.1 Run Length Coding (RLC) .................................................... 2366.5.2 Block Coding ......................................................................... 237

6.6 QPAC: Quality Preserving Adaptive Compression ........................... 2386.7 Some Common Image Formats ......................................................... 239

6.7.1 C ++ Code for Reading BMP Image ...................................... 2406.7.2 JPEG ...................................................................................... 2456.7.3 GIF ......................................................................................... 254

6.8 Matlab Codes and Pseudocodes ......................................................... 2586.8.1 Block Truncation Compression (BTC) .................................. 2586.8.2 JPEG Compression ................................................................ 2616.8.3 GIF: LZW Compression ........................................................ 266 6.8.4 GIF: LZW Decompression .................................................... 267

References ................................................................................................... 267

7 Morphology-Based Image Processing ...................................................... 2697.1 Basics of Set Theory .......................................................................... 2697.2 Logic Operations on Binary Images .................................................. 2717.3 Dilation and Erosion .......................................................................... 273

7.3.1 Dilation .................................................................................. 2737.3.2 Erosion ................................................................................... 276

7.4 Opening and Closing .......................................................................... 2797.5 Hit–Miss Transform ........................................................................... 2807.6 Morphological Algorithms for Feature Extraction ............................ 280

7.6.1 Boundary Extraction .............................................................. 2827.6.2 Region Filling ........................................................................ 2837.6.3 Pixel Connectivity .................................................................. 2847.6.4 Convex Hull ........................................................................... 2857.6.5 Thinning ................................................................................. 2867.6.6 Thickening ............................................................................. 2887.6.7 Object Skeletons .................................................................... 2897.6.8 Pruning ................................................................................... 290

7.7 Case Studies ....................................................................................... 2937.7.1 Boundary Detection ............................................................... 2937.7.2 Region Filling ........................................................................ 2957.7.3 Binary Skeleton ...................................................................... 295

7.8 MATLAB Codes ................................................................................ 2967.8.1 Dilation .................................................................................. 2967.8.2 Erosion ................................................................................... 2977.8.3 Boundary Detection ............................................................... 297

Reference .................................................................................................... 298

8 Patterns in Images and Their Applications ............................................. 2998.1 Introduction to Pattern ....................................................................... 2998.2 Features .............................................................................................. 300

8.2.1 Feature Selection and Extraction ........................................... 301

xxii Contents

8.3 Principal Component Analysis ........................................................... 3028.3.1 Algorithm of PCA .................................................................. 3038.3.2 Application of PCA in Face Recognition ............................... 3058.3.3 Limitations of PCA-Based Face Recognition ........................ 307

8.4 Face Detection Based on Haar-Like Features .................................... 3088.5 Elastic Branch Graph Matching and Face Manifold .......................... 3118.6 Decision Tree and Feature Hierarchy ................................................ 314

8.6.1 Information Gain .................................................................... 3148.6.2 Information Gain Ratio .......................................................... 3158.6.3 Selection of Optimized Set of Features ................................. 3168.6.4 Feature Hierarchy for Gabor Features in Face

Recognition ............................................................................ 3178.7 Scale Invariant Feature Transform ..................................................... 319

8.7.1 Scale–Space Concept: Multiscale Singularity Tree ............... 3208.7.2 SIFT: Representation of Image in Scale–Space ..................... 3228.7.3 SIFT: Detection of Local Scale–Space Extrema .................... 3248.7.4 SIFT: Accurate Keypoint Localization .................................. 3258.7.5 SIFT: Orientation Assignment ............................................... 3268.7.6 SIFT: Keypoint Descriptor ..................................................... 3278.7.7 SIFT: Results .......................................................................... 328

8.8 Histogram of Oriented Gradient ........................................................ 3328.8.1 HOG: Dividing Image into Blocks ........................................ 3338.8.2 HOG: Quantization of Gradient Histogram ........................... 3338.8.3 HOG: Feature Vector Synthesis ............................................. 3358.8.4 HOG: Design of Classifier by Training ................................. 335

8.9 Matlab Codes ..................................................................................... 3368.9.1 PCA of a 2D data set .............................................................. 3368.9.2 Scale–Space: Multiscale Singularity Tree ............................. 337

Reference .................................................................................................... 338

9 Psycho-visual pattern recognition: Computer Vision ............................ 3419.1 Introduction ........................................................................................ 3419.2 Receptive Field .................................................................................. 342

9.2.1 On-Center Off-Surround ........................................................ 3439.2.2 Off-Center On-Surround ........................................................ 3449.2.3 Edge Detection in Retinal Receptive Field ............................ 345

9.3 Modeling of Retinal Receptive Field from Optical Illusions ............. 3479.3.1 Optical Illusions: A study ....................................................... 3479.3.2 Illustration of the Illusions in Terms of DoG Model of

Retinal Receptive Field .......................................................... 3489.4 Three Levels of Psycho-Visual System for Pattern Recognition ....... 3529.5 Neuro-Visually Inspired Figure-Ground Segregation ........................ 353

9.5.1 The Detailed Algorithm for NFGS ......................................... 3559.6 “Where” and “What” Visual Pathways: Modeling in Computer

Vision ................................................................................................. 358References ................................................................................................... 362

xxiiiContents

10 Appendix A: Digital Differentiation and Edge Detection ....................... 36510.1 Edge in an Image ............................................................................... 36510.2 Digital Differentiation ........................................................................ 366

10.2.1 Digital Differentiation of One-Dimensional (1D) Signal ...... 36710.3 Digital Differentiation for Edge Detection ........................................ 36910.4 Convolution and Correlation for Edge Detection .............................. 37110.5 Prewitt and Sobel Mask for Edge Detection of Digital Image .......... 37410.6 Canny Edge Detector ......................................................................... 375

10.6.1 Noise Reduction ..................................................................... 37510.6.2 Non-Maxima Suppression ..................................................... 37610.6.3 Hysteresis Thresholding ......................................................... 376

10.7 MATLAB Codes ................................................................................ 37810.7.1 Digital Differentiation of 1D Signal ...................................... 37810.7.2 Detection of Edges in Orthogonal Directions by Convolu-

tion Interpretation of Digital Differentiation ......................... 379References ................................................................................................... 381

11 Appendix B: Elementary Probability Theory .......................................... 38311.1 Concept of Probability ....................................................................... 385

11.1.1 Random Experiments and Sample Space ............................... 38511.1.2 Events ..................................................................................... 38511.1.3 Probability: Understanding Approaches ................................ 386

11.2 Random Variable ................................................................................ 38611.3 Mean, Variance, Skewness, and Kurtosis ........................................... 38711.4 Cumulative Distribution Function ..................................................... 38911.5 Probability Density Function ............................................................. 392

11.5.1 Uniform PDF .......................................................................... 39311.6 Frequently Used Probability Distribution .......................................... 393References ................................................................................................... 397

12 Appendix C: Frequently Used MATLAB Functions .............................. 39912.1 plot() ................................................................................................... 399

12.1.1 Syntax .................................................................................... 39912.1.2 Description ............................................................................. 399

12.2 imshow() ............................................................................................ 40012.2.1 Syntax .................................................................................... 40012.2.2 Description ............................................................................. 400

12.3 drawnow() .......................................................................................... 40112.3.1 Syntax .................................................................................... 40112.3.2 Description ............................................................................. 401

12.4 stairs() ................................................................................................ 40112.5 int2str() ............................................................................................... 402

12.5.1 Syntax .................................................................................... 40212.5.2 Description ............................................................................. 402

12.6 conv() ................................................................................................. 40212.7 conv2() ............................................................................................... 403

xxiv Contents

12.8 Two-Dimensional Convolution .......................................................... 40312.9 ginput() ............................................................................................... 40412.10 bitget() .............................................................................................. 40512.11 bitset() .............................................................................................. 40512.12 dec2bin() .......................................................................................... 406

12.12.1 Syntax .................................................................................. 40612.12.2 Description ........................................................................... 406

12.13 fft2() ................................................................................................. 40712.13.1 Syntax .................................................................................. 40712.13.2 Description ........................................................................... 407

12.14 fftshift() ............................................................................................ 40712.14.1 Syntax .................................................................................. 40712.14.2 Description ........................................................................... 408

12.15 wavefun() ......................................................................................... 40912.15.1 Syntax .................................................................................. 40912.15.2 Description ........................................................................... 410

12.16 Fourier Synthesizer GUI .................................................................. 412Reference .................................................................................................... 412

Index .................................................................................................................. 413