Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Programming Computer Vision with Python
Preface
Prerequisites and Overview
What You Need to Know
What You Will Learn
Chapter Overview
Introduction to Computer Vision
Python and NumPy
Notation and Conventions
Using Code Examples
How to Contact Us
Safari® Books Online
Acknowledgments
1. Basic Image Handling and Processing
1.1 PIL—The Python Imaging Library
Convert Images to Another Format
Create Thumbnails
Copy and Paste Regions
Resize and Rotate
1.2 Matplotlib
Plotting Images, Points, and Lines
Image Contours and Histograms
Interactive Annotation
1.3 NumPy
Array Image Representation
Graylevel Transforms
Image Resizing
Histogram Equalization
Averaging Images
PCA of Images
Using the Pickle Module
1.4 SciPy
Blurring Images
Image Derivatives
Morphology—Counting Objects
Useful SciPy Modules
Reading and writing .mat files
Saving arrays as images
1.5 Advanced Example: Image De-Noising
Exercises
Conventions for the Code Examples
2. Local Image Descriptors
2.1 Harris Corner Detector
Finding Corresponding Points Between Images
2.2 SIFT—Scale-Invariant Feature Transform
Interest Points
Descriptor
Detecting Interest Points
Matching Descriptors
2.3 Matching Geotagged Images
Downloading Geotagged Images from Panoramio
Matching Using Local Descriptors
Visualizing Connected Images
Exercises
3. Image to Image Mappings
3.1 Homographies
The Direct Linear Transformation Algorithm
Affine Transformations
3.2 Warping Images
Image in Image
Piecewise Affine Warping
Registering Images
3.3 Creating Panoramas
RANSAC
Robust Homography Estimation
Stitching the Images Together
Exercises
4. Camera Models and Augmented Reality
4.1 The Pin-Hole Camera Model
The Camera Matrix
Projecting 3D Points
Factoring the Camera Matrix
Computing the Camera Center
4.2 Camera Calibration
A Simple Calibration Method
4.3 Pose Estimation from Planes and Markers
4.4 Augmented Reality
PyGame and PyOpenGL
From Camera Matrix to OpenGL Format
Placing Virtual Objects in the Image
Tying It All Together
Loading Models
Exercises
5. Multiple View Geometry
5.1 Epipolar Geometry
A Sample Data Set
Plotting 3D Data with Matplotlib
Computing F—The Eight Point Algorithm
The Epipole and Epipolar Lines
5.2 Computing with Cameras and 3D Structure
Triangulation
Computing the Camera Matrix from 3D Points
Computing the Camera Matrix from a Fundamental Matrix
The uncalibrated case—projective reconstruction
The calibrated case—metric reconstruction
5.3 Multiple View Reconstruction
Robust Fundamental Matrix Estimation
3D Reconstruction Example
Extensions and More Than Two Views
More views
Bundle adjustment
Self-calibration
5.4 Stereo Images
Computing Disparity Maps
Exercises
6. Clustering Images
6.1 K-Means Clustering
The SciPy Clustering Package
Clustering Images
Visualizing the Images on Principal Components
Clustering Pixels
6.2 Hierarchical Clustering
Clustering Images
6.3 Spectral Clustering
Exercises
7. Searching Images
7.1 Content-Based Image Retrieval
Inspiration from Text Mining—The Vector Space Model
7.2 Visual Words
Creating a Vocabulary
7.3 Indexing Images
Setting Up the Database
Adding Images
7.4 Searching the Database for Images
Using the Index to Get Candidates
Querying with an Image
Benchmarking and Plotting the Results
7.5 Ranking Results Using Geometry
7.6 Building Demos and Web Applications
Creating Web Applications with CherryPy
Image Search Demo
Exercises
8. Classifying Image Content
8.1 K-Nearest Neighbors
A Simple 2D Example
Dense SIFT as Image Feature
Classifying Images—Hand Gesture Recognition
8.2 Bayes Classifier
Using PCA to Reduce Dimensions
8.3 Support Vector Machines
Using LibSVM
Hand Gesture Recognition Again
8.4 Optical Character Recognition
Training a Classifier
Selecting Features
Multi-Class SVM
Extracting Cells and Recognizing Characters
Rectifying Images
Exercises
9. Image Segmentation
9.1 Graph Cuts
Graphs from Images
Segmentation with User Input
9.2 Segmentation Using Clustering
9.3 Variational Methods
Exercises
10. OpenCV
10.1 The OpenCV Python Interface
10.2 OpenCV Basics
Reading and Writing Images
Color Spaces
Displaying Images and Results
10.3 Processing Video
Video Input
Reading Video to NumPy Arrays
10.4 Tracking
Optical Flow
The Lucas-Kanade Algorithm
Using the tracker
Using generators
10.5 More Examples
Inpainting
Segmentation with the Watershed Transform
Line Detection with a Hough Transform
Exercises
A. Installing Packages
A.1 NumPy and SciPy
Windows
Mac OS X
Linux
A.2 Matplotlib
A.3 PIL
A.4 LibSVM
A.5 OpenCV
Windows and Unix
Mac OS X
Linux
A.6 VLFeat
A.7 PyGame
A.8 PyOpenGL
A.9 Pydot
A.10 Python-graph
A.11 Simplejson
A.12 PySQLite
A.13 CherryPy
B. Image Datasets
B.1 Flickr
B.2 Panoramio
B.3 Oxford Visual Geometry Group
B.4 University of Kentucky Recognition Benchmark Images
B.5 Other
Prague Texture Segmentation Datagenerator and Benchmark
MSR Cambridge Grab Cut Dataset
Caltech 101
Static Hand Posture Database
Middlebury Stereo Datasets
C. Image Credits
C.1 Images from Flickr
C.2 Other Images
C.3 Illustrations
D. References
E. About the Author
Index
About the Author
Colophon
Copyright
← Prev
Back
Next →
← Prev
Back
Next →