OpenCV: Computer Vision Projects with Python

Get savvy with OpenCV and actualize cool computer vision applications

OpenCV: Computer Vision Projects with Python

This ebook is included in a Mapt subscription
Joseph Howse, Prateek Joshi, Michael Beyeler

Get savvy with OpenCV and actualize cool computer vision applications
$10.00
$79.99
RRP $63.99
RRP $79.99
eBook
Print + eBook
Preview in Mapt

Book Details

ISBN 139781787125490
Paperback558 pages

Book Description

OpenCV is a state-of-art computer vision library that allows a great variety of image and video processing operations. OpenCV for Python enables us to run computer vision algorithms in real time. This learning path proposes to teach the following topics. First, we will learn how to get started with OpenCV and OpenCV3’s Python API, and develop a computer vision application that tracks body parts. Then, we will build amazing intermediate-level computer vision applications such as making an object disappear from an image, identifying different shapes, reconstructing a 3D map from images , and building an augmented reality application, Finally, we’ll move to more advanced projects such as hand gesture recognition, tracking visually salient objects, as well as recognizing traffic signs and emotions on faces using support vector machines and multi-layer perceptrons respectively.

This Learning Path combines some of the best that Packt has to offer in one complete, curated package. It includes content from the following Packt products:

Table of Contents

Chapter 1: Setting up OpenCV
Choosing and using the right setup tools
Running samples
Finding documentation, help, and updates
Summary
Chapter 2: Handling Files, Cameras, and GUIs
Basic I/O scripts
Project concept
An object-oriented design
Summary
Chapter 3: Filtering Images
Creating modules
Channel mixing – seeing in Technicolor
Curves – bending color space
Highlighting edges
Custom kernels – getting convoluted
Modifying the application
Summary
Chapter 4: Tracking Faces with Haar Cascades
Conceptualizing Haar cascades
Getting Haar cascade data
Creating modules
Defining a face as a hierarchy of rectangles
Tracing, cutting, and pasting rectangles
Adding more utility functions
Tracking faces
Modifying the application
Summary
Chapter 5: Detecting Foreground/Background Regions and Depth
Creating modules
Capturing frames from a depth camera
Creating a mask from a disparity map
Masking a copy operation
Modifying the application
Summary
Chapter 6: Detecting Edges and Applying Image Filters
2D convolution
Blurring
Edge detection
Motion blur
Sharpening
Embossing
Erosion and dilation
Creating a vignette filter
Enhancing the contrast in an image
Summary
Chapter 7: Cartoonizing an Image
Accessing the webcam
Keyboard inputs
Mouse inputs
Interacting with a live video stream
Cartoonizing an image
Summary
Chapter 8: Detecting and Tracking Different Body Parts
Using Haar cascades to detect things
What are integral images?
Detecting and tracking faces
Fun with faces
Detecting eyes
Fun with eyes
Detecting ears
Detecting a mouth
It's time for a moustache
Detecting a nose
Detecting pupils
Summary
Chapter 9: Extracting Features from an Image
Why do we care about keypoints?
What are keypoints?
Detecting the corners
Good Features To Track
Scale Invariant Feature Transform (SIFT)
Speeded Up Robust Features (SURF)
Features from Accelerated Segment Test (FAST)
Binary Robust Independent Elementary Features (BRIEF)
Oriented FAST and Rotated BRIEF (ORB)
Summary
Chapter 10: Creating a Panoramic Image
Matching keypoint descriptors
Creating the panoramic image
What if the images are at an angle to each other?
Summary
Chapter 11: Seam Carving
Why do we care about seam carving?
How does it work?
How do we define "interesting"?
How do we compute the seams?
Can we expand an image?
Can we remove an object completely?
Summary
Chapter 12: Detecting Shapes and Segmenting an Image
Contour analysis and shape matching
Approximating a contour
Identifying the pizza with the slice taken out
How to censor a shape?
What is image segmentation?
Watershed algorithm
Summary
Chapter 13: Object Tracking
Frame differencing
Colorspace based tracking
Building an interactive object tracker
Feature based tracking
Background subtraction
Summary
Chapter 14: Object Recognition
Object detection versus object recognition
What is a dense feature detector?
What is a visual dictionary?
What is supervised and unsupervised learning?
What are Support Vector Machines?
How do we actually implement this?
Summary
Chapter 15: Stereo Vision and 3D Reconstruction
What is stereo correspondence?
What is epipolar geometry?
Building the 3D map
Summary
Chapter 16: Augmented Reality
What is the premise of augmented reality?
What does an augmented reality system look like?
Geometric transformations for augmented reality
What is pose estimation?
How to track planar objects?
How to augment our reality?
Let's add some movements
Summary
Chapter 17: Fun with Filters
Planning the app
Creating a black-and-white pencil sketch
Generating a warming/cooling filter
Cartoonizing an image
Putting it all together
Summary
Chapter 18: Hand Gesture Recognition Using a Kinect Depth Sensor
Planning the app
Setting up the app
Tracking hand gestures in real time
Hand region segmentation
Hand shape analysis
Hand gesture recognition
Summary
Chapter 19: Finding Objects via Feature Matching and Perspective Transforms
Tasks performed by the app
Planning the app
Setting up the app
The process flow
Feature extraction
Feature matching
Feature tracking
Seeing the algorithm in action
Summary
Chapter 20: 3D Scene Reconstruction Using Structure from Motion
Planning the app
Camera calibration
Setting up the app
Estimating the camera motion from a pair of images
Reconstructing the scene
3D point cloud visualization
Summary
Chapter 21: Tracking Visually Salient Objects
Planning the app
Setting up the app
Visual saliency
Mean-shift tracking
Putting it all together
Summary
Chapter 22: Learning to Recognize Traffic Signs
Planning the app
Supervised learning
The GTSRB dataset
Feature extraction
Support Vector Machine
Putting it all together
Summary
Chapter 23: Learning to Recognize Emotions on Faces
Planning the app
Face detection
Facial expression recognition
Putting it all together
Summary

What You Will Learn

  • Install OpenCV and related software such as Python, NumPy, SciPy, OpenNI, and SensorKinect - all on Windows, Mac or Ubuntu
  • Apply “curves” and other color transformations to simulate the look of old photos, movies, or video games
  • Apply geometric transformations to images, perform image filtering, and convert an image into a cartoon-like image
  • Recognize hand gestures in real time and perform hand-shape analysis based on the output of a Microsoft Kinect sensor
  • Reconstruct a 3D real-world scene from 2D camera motion and common camera reprojection techniques
  • Detect and recognize street signs using a cascade classifier and support vector machines (SVMs)
  • Identify emotional expressions in human faces using convolutional neural networks (CNNs) and SVMs
  • Strengthen your OpenCV2 skills and learn how to use new OpenCV3 features

Authors

Table of Contents

Chapter 1: Setting up OpenCV
Choosing and using the right setup tools
Running samples
Finding documentation, help, and updates
Summary
Chapter 2: Handling Files, Cameras, and GUIs
Basic I/O scripts
Project concept
An object-oriented design
Summary
Chapter 3: Filtering Images
Creating modules
Channel mixing – seeing in Technicolor
Curves – bending color space
Highlighting edges
Custom kernels – getting convoluted
Modifying the application
Summary
Chapter 4: Tracking Faces with Haar Cascades
Conceptualizing Haar cascades
Getting Haar cascade data
Creating modules
Defining a face as a hierarchy of rectangles
Tracing, cutting, and pasting rectangles
Adding more utility functions
Tracking faces
Modifying the application
Summary
Chapter 5: Detecting Foreground/Background Regions and Depth
Creating modules
Capturing frames from a depth camera
Creating a mask from a disparity map
Masking a copy operation
Modifying the application
Summary
Chapter 6: Detecting Edges and Applying Image Filters
2D convolution
Blurring
Edge detection
Motion blur
Sharpening
Embossing
Erosion and dilation
Creating a vignette filter
Enhancing the contrast in an image
Summary
Chapter 7: Cartoonizing an Image
Accessing the webcam
Keyboard inputs
Mouse inputs
Interacting with a live video stream
Cartoonizing an image
Summary
Chapter 8: Detecting and Tracking Different Body Parts
Using Haar cascades to detect things
What are integral images?
Detecting and tracking faces
Fun with faces
Detecting eyes
Fun with eyes
Detecting ears
Detecting a mouth
It's time for a moustache
Detecting a nose
Detecting pupils
Summary
Chapter 9: Extracting Features from an Image
Why do we care about keypoints?
What are keypoints?
Detecting the corners
Good Features To Track
Scale Invariant Feature Transform (SIFT)
Speeded Up Robust Features (SURF)
Features from Accelerated Segment Test (FAST)
Binary Robust Independent Elementary Features (BRIEF)
Oriented FAST and Rotated BRIEF (ORB)
Summary
Chapter 10: Creating a Panoramic Image
Matching keypoint descriptors
Creating the panoramic image
What if the images are at an angle to each other?
Summary
Chapter 11: Seam Carving
Why do we care about seam carving?
How does it work?
How do we define "interesting"?
How do we compute the seams?
Can we expand an image?
Can we remove an object completely?
Summary
Chapter 12: Detecting Shapes and Segmenting an Image
Contour analysis and shape matching
Approximating a contour
Identifying the pizza with the slice taken out
How to censor a shape?
What is image segmentation?
Watershed algorithm
Summary
Chapter 13: Object Tracking
Frame differencing
Colorspace based tracking
Building an interactive object tracker
Feature based tracking
Background subtraction
Summary
Chapter 14: Object Recognition
Object detection versus object recognition
What is a dense feature detector?
What is a visual dictionary?
What is supervised and unsupervised learning?
What are Support Vector Machines?
How do we actually implement this?
Summary
Chapter 15: Stereo Vision and 3D Reconstruction
What is stereo correspondence?
What is epipolar geometry?
Building the 3D map
Summary
Chapter 16: Augmented Reality
What is the premise of augmented reality?
What does an augmented reality system look like?
Geometric transformations for augmented reality
What is pose estimation?
How to track planar objects?
How to augment our reality?
Let's add some movements
Summary
Chapter 17: Fun with Filters
Planning the app
Creating a black-and-white pencil sketch
Generating a warming/cooling filter
Cartoonizing an image
Putting it all together
Summary
Chapter 18: Hand Gesture Recognition Using a Kinect Depth Sensor
Planning the app
Setting up the app
Tracking hand gestures in real time
Hand region segmentation
Hand shape analysis
Hand gesture recognition
Summary
Chapter 19: Finding Objects via Feature Matching and Perspective Transforms
Tasks performed by the app
Planning the app
Setting up the app
The process flow
Feature extraction
Feature matching
Feature tracking
Seeing the algorithm in action
Summary
Chapter 20: 3D Scene Reconstruction Using Structure from Motion
Planning the app
Camera calibration
Setting up the app
Estimating the camera motion from a pair of images
Reconstructing the scene
3D point cloud visualization
Summary
Chapter 21: Tracking Visually Salient Objects
Planning the app
Setting up the app
Visual saliency
Mean-shift tracking
Putting it all together
Summary
Chapter 22: Learning to Recognize Traffic Signs
Planning the app
Supervised learning
The GTSRB dataset
Feature extraction
Support Vector Machine
Putting it all together
Summary
Chapter 23: Learning to Recognize Emotions on Faces
Planning the app
Face detection
Facial expression recognition
Putting it all together
Summary

Book Details

ISBN 139781787125490
Paperback558 pages
Read More

Read More Reviews