Free E-book OpenCV 2 Computer Vision Application Programming Cookbook

    Free E-book OpenCV 2 Computer Vision Application Programming Cookbook

Free E-book OpenCV 2 Computer Vision Application Programming Cookbook
Free E-book OpenCV 2 Computer Vision Application Programming Cookbook

Table of Contents

Preface 1
Chapter 1: Playing with Images 7
Introduction 7
Installing the OpenCV library 8
Creating an OpenCV project with MS Visual C++ 11
Creating an OpenCV project with Qt 19
Loading, displaying, and saving images 26
Creating a GUI application using Qt 30

Chapter 2: Manipulating the Pixels 37

Introduction 37
Accessing pixel values 38
Scanning an image with pointers 41
Scanning an image with iterators 49
Writing efficient image scanning loops 51
Scanning an image with neighbor access 55
Performing simple image arithmetic 59
Defining regions of interest 63

Chapter 3: Processing Images with Classes 69

Introduction 69
Using the Strategy pattern in algorithm design 70
Using a Controller to communicate with processing modules 76
Using the Singleton design pattern 80
Using the Model-View-Controller architecture to design an application 82
Converting color spaces 85

Chapter 4: Counting the Pixels with Histograms 89

Introduction 89
Computing the image histogram 89
Applying look-up tables to modify image appearance 96
Equalizing the image histogram 101
Backprojecting a histogram to detect specific image content 103
Using the mean shift algorithm to find an object 108
Retrieving similar images using histogram comparison 112

Chapter 5: Transforming Images with Morphological Operations 117

Introduction 117
Eroding and dilating images using morphological filters 118
Opening and closing images using morphological filters 122
Detecting edges and corners using morphological filters 125
Segmenting images using watersheds 131
Extracting foreground objects with the GrabCut algorithm 137

Chapter 6: Filtering the Images 141

Introduction 141
Filtering images using low-pass filters 142
Filtering images using a median filter 147
Applying directional filters to detect edges 148
Computing the Laplacian of an image 156
Chapter 7: Extracting Lines, Contours, and Components 163
Introduction 163
Detecting image contours with the Canny operator 164
Detecting lines in images with the Hough transform 167
Fitting a line to a set of points 178
Extracting the components' contours 182

Computing components' shape descriptors 186

Chapter 8: Detecting and Matching Interest Points 191

Introduction 191
Detecting Harris corners 192
Detecting FAST features 203
Detecting the scale-invariant SURF features 206
Describing SURF features 212
Chapter 9: Estimating Projective Relations in Images 217
Introduction 217
Calibrating a camera 219
Computing the fundamental matrix of an image pair 228
Matching images using random sample consensus 233
Computing a homography between two images 242

Chapter 10: Processing Video Sequences 247

Introduction 247
Reading video sequences 248
Processing the video frames 251
Writing video sequences 261
Tracking feature points in video 266
Extracting the foreground objects in video 272
 Index 279


Publier un commentaire

0 Commentaires