logo资料库

learning opencv 3 computer vision with python.pdf

第1页 / 共356页
第2页 / 共356页
第3页 / 共356页
第4页 / 共356页
第5页 / 共356页
第6页 / 共356页
第7页 / 共356页
第8页 / 共356页
资料共356页,剩余部分请下载后查看
Cover
Table of Contents
About the Authors
Preface
1. Setting Up OpenCV
Choosing and using the right setup tools
Installation on Windows
Using binary installers (no support for depth cameras)
Using CMake and compilers
Installing on OS X
Using MacPorts with ready-made packages
Using MacPorts with your own custom packages
Using Homebrew with ready-made packages (no support for depth cameras)
Using Homebrew with your own custom packages
Installation on Ubuntu and its derivatives
Using the Ubuntu repository (no support for depth cameras)
Building OpenCV from a source
Installation on other Unix-like systems
Installing the Contrib modules
Running samples
Finding documentation, help, and updates
Summary
2. Handling Files, Cameras, and GUIs
Basic I/O scripts
Reading/writing an image file
Converting between an image and raw bytes
Accessing image data with numpy.array
Reading/writing a video file
Capturing camera frames
Displaying images in a window
Displaying camera frames in a window
Project Cameo (face tracking and image manipulation)
Cameo – an object-oriented design
Abstracting a video stream with managers.CaptureManager
Abstracting a window and keyboard with managers.WindowManager
Applying everything with cameo.Cameo
Summary
3. Processing Images with OpenCV 3
Converting between different color spaces
A quick note on BGR
The Fourier Transform
High pass filter
Low pass filter
Creating modules
Edge detection
Custom kernels – getting convoluted
Modifying the application
Edge detection with Canny
Contour detection
Contours – bounding box, minimum area rectangle, and minimum enclosing circle
Contours – convex contours and the Douglas-Peucker algorithm
Line and circle detection
Line detection
Circle detection
Detecting shapes
Summary
4. Depth Estimation and Segmentation
Creating modules
Capturing frames from a depth camera
Creating a mask from a disparity map
Masking a copy operation
Depth estimation with a normal camera
Object segmentation using the Watershed and GrabCut algorithms
Example of foreground detection with GrabCut
Image segmentation with the Watershed algorithm
Summary
5. Detecting and Recognizing Faces
Conceptualizing Haar cascades
Getting Haar cascade data
Using OpenCV to perform face detection
Performing face detection on a still image
Performing face detection on a video
Performing face recognition
Generating the data for face recognition
Recognizing faces
Preparing the training data
Loading the data and recognizing faces
Performing an Eigenfaces recognition
Performing face recognition with Fisherfaces
Performing face recognition with LBPH
Discarding results with confidence score
Summary
6. Retrieving Images and Searching Using Image Descriptors
Feature detection algorithms
Defining features
Detecting features – corners
Feature extraction and description using DoG and SIFT
Anatomy of a keypoint
Feature extraction and detection using Fast Hessian and SURF
ORB feature detection and feature matching
FAST
BRIEF
Brute-Force matching
Feature matching with ORB
Using K-Nearest Neighbors matching
FLANN-based matching
FLANN matching with homography
A sample application – tattoo forensics
Saving image descriptors to file
Scanning for matches
Summary
7. Detecting and Recognizing Objects
Object detection and recognition techniques
HOG descriptors
The scale issue
The location issue
Image pyramid
Sliding windows
Non-maximum (or non-maxima) suppression
Support vector machines
People detection
Creating and training an object detector
Bag-of-words
BOW in computer vision
The k-means clustering
Detecting cars
What did we just do?
SVM and sliding windows
Example – car detection in a scene
Examining detector.py
Associating training data with classes
Dude, where's my car?
Summary
8. Tracking Objects
Detecting moving objects
Basic motion detection
Background subtractors – KNN, MOG2, and GMG
Meanshift and CAMShift
Color histograms
The calcHist function
The calcBackProject function
In summary
Back to the code
CAMShift
The Kalman filter
Predict and update
An example
A real-life example – tracking pedestrians
The application workflow
A brief digression – functional versus object-oriented programming
The Pedestrian class
The main program
Where do we go from here?
Summary
9. Neural Networks with OpenCV – an Introduction
Artificial neural networks
Neurons and perceptrons
The structure of an ANN
Network layers by example
The input layer
The output layer
The hidden layer
The learning algorithms
ANNs in OpenCV
ANN-imal classification
Training epochs
Handwritten digit recognition with ANNs
MNIST – the handwritten digit database
Customized training data
The initial parameters
The input layer
The hidden layer
The output layer
Training epochs
Other parameters
Mini-libraries
The main file
Possible improvements and potential applications
Improvements
Potential applications
Summary
To boldly go…
Index
Learning OpenCV 3 Computer Vision with Python Second Edition
Table of Contents Learning OpenCV 3 Computer Vision with Python Second Edition Credits About the Authors About the Reviewers www.PacktPub.com Support files, eBooks, discount offers, and more Why subscribe? Free access for Packt account holders Preface What this book covers What you need for this book Who this book is for Conventions Reader feedback Customer support Downloading the example code Errata Piracy Questions 1. Setting Up OpenCV Choosing and using the right setup tools Installation on Windows Using binary installers (no support for depth cameras) Using CMake and compilers Installing on OS X Using MacPorts with ready-made packages Using MacPorts with your own custom packages Using Homebrew with ready-made packages (no support for depth cameras) Using Homebrew with your own custom packages
Installation on Ubuntu and its derivatives Using the Ubuntu repository (no support for depth cameras) Building OpenCV from a source Installation on other Unix-like systems Installing the Contrib modules Running samples Finding documentation, help, and updates Summary 2. Handling Files, Cameras, and GUIs Basic I/O scripts Reading/writing an image file Converting between an image and raw bytes Accessing image data with numpy.array Reading/writing a video file Capturing camera frames Displaying images in a window Displaying camera frames in a window Project Cameo (face tracking and image manipulation) Cameo – an object-oriented design Abstracting a video stream with managers.CaptureManager Abstracting a window and keyboard with managers.WindowManager Applying everything with cameo.Cameo Summary 3. Processing Images with OpenCV 3 Converting between different color spaces A quick note on BGR The Fourier Transform High pass filter Low pass filter Creating modules Edge detection
Custom kernels – getting convoluted Modifying the application Edge detection with Canny Contour detection Contours – bounding box, minimum area rectangle, and minimum enclosing circle Contours – convex contours and the Douglas-Peucker algorithm Line and circle detection Line detection Circle detection Detecting shapes Summary 4. Depth Estimation and Segmentation Creating modules Capturing frames from a depth camera Creating a mask from a disparity map Masking a copy operation Depth estimation with a normal camera Object segmentation using the Watershed and GrabCut algorithms Example of foreground detection with GrabCut Image segmentation with the Watershed algorithm Summary 5. Detecting and Recognizing Faces Conceptualizing Haar cascades Getting Haar cascade data Using OpenCV to perform face detection Performing face detection on a still image Performing face detection on a video Performing face recognition Generating the data for face recognition Recognizing faces Preparing the training data
Loading the data and recognizing faces Performing an Eigenfaces recognition Performing face recognition with Fisherfaces Performing face recognition with LBPH Discarding results with confidence score Summary 6. Retrieving Images and Searching Using Image Descriptors Feature detection algorithms Defining features Detecting features – corners Feature extraction and description using DoG and SIFT Anatomy of a keypoint Feature extraction and detection using Fast Hessian and SURF ORB feature detection and feature matching FAST BRIEF Brute-Force matching Feature matching with ORB Using K-Nearest Neighbors matching FLANN-based matching FLANN matching with homography A sample application – tattoo forensics Saving image descriptors to file Scanning for matches Summary 7. Detecting and Recognizing Objects Object detection and recognition techniques HOG descriptors The scale issue The location issue Image pyramid
Sliding windows Non-maximum (or non-maxima) suppression Support vector machines People detection Creating and training an object detector Bag-of-words BOW in computer vision The k-means clustering Detecting cars What did we just do? SVM and sliding windows Example – car detection in a scene Examining detector.py Associating training data with classes Dude, where’s my car? Summary 8. Tracking Objects Detecting moving objects Basic motion detection Background subtractors – KNN, MOG2, and GMG Meanshift and CAMShift Color histograms The calcHist function The calcBackProject function In summary Back to the code CAMShift The Kalman filter Predict and update An example A real-life example – tracking pedestrians
分享到:
收藏