Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
1. Basic Image Handling and Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 PIL—The Python Imaging Library 1
1.2 Matplotlib 3
1.3 NumPy 7
1.4 SciPy 16
1.5 Advanced Example: Image De-Noising 23
Exercises 26
Conventions for the Code Examples 27
2. Local Image Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.1 Harris Corner Detector 29
2.2 SIFT—Scale-Invariant Feature Transform 36
2.3 Matching Geotagged Images 44
Exercises 51
3. Image to Image Mappings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.1 Homographies 53
3.2 Warping Images 57
3.3 Creating Panoramas 70
Exercises 77
4. Camera Models and Augmented Reality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
4.1 The Pin-Hole Camera Model 79
4.2 Camera Calibration 84
4.3 Pose Estimation from Planes and Markers 86
4.4 Augmented Reality 89
Exercises 98
iii
5. Multiple View Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
5.1 Epipolar Geometry 99
5.2 Computing with Cameras and 3D Structure 107
5.3 Multiple View Reconstruction 113
5.4 Stereo Images 120
Exercises 125
6. Clustering Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
6.1 K-Means Clustering 127
6.2 Hierarchical Clustering 133
6.3 Spectral Clustering 140
Exercises 145
7. Searching Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
7.1 Content-Based Image Retrieval 147
7.2 VisualWords 148
7.3 Indexing Images 151
7.4 Searching the Database for Images 155
7.5 Ranking Results Using Geometry 160
7.6 Building Demos andWeb Applications 162
Exercises 165
8. Classifying Image Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
8.1 K-Nearest Nei
1