OpenCV: Computer Vision Projects with Python
eBook - ePub

OpenCV: Computer Vision Projects with Python

Joseph Howse, Prateek Joshi, Michael Beyeler

Share book
  1. 558 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

OpenCV: Computer Vision Projects with Python

Joseph Howse, Prateek Joshi, Michael Beyeler

Book details
Book preview
Table of contents
Citations

About This Book

Get savvy with OpenCV and actualize cool computer vision applications

About This Book

  • Use OpenCV's Python bindings to capture video, manipulate images, and track objects
  • Learn about the different functions of OpenCV and their actual implementations.
  • Develop a series of intermediate to advanced projects using OpenCV and Python

Who This Book Is For

This learning path is for someone who has a working knowledge of Python and wants to try out OpenCV. This Learning Path will take you from a beginner to an expert in computer vision applications using OpenCV. OpenCV's application are humongous and this Learning Path is the best resource to get yourself acquainted thoroughly with OpenCV.

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

In Detail

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:

  • OpenCV Computer Vision with Python by Joseph Howse
  • OpenCV with Python By Example by Prateek Joshi
  • OpenCV with Python Blueprints by Michael Beyeler

Style and approach

This course aims to create a smooth learning path that will teach you how to get started with will learn how to get started with OpenCV and OpenCV 3's Python API, and develop superb computer vision applications. Through this comprehensive course, you'll learn to create computer vision applications from scratch to finish and more!.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is OpenCV: Computer Vision Projects with Python an online PDF/ePUB?
Yes, you can access OpenCV: Computer Vision Projects with Python by Joseph Howse, Prateek Joshi, Michael Beyeler in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Python. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781787125490
Edition
1

OpenCV: Computer Vision Projects with Python


Table of Contents

OpenCV: Computer Vision Projects with Python
OpenCV: Computer Vision Projects with Python
Credits
Preface
What this learning path covers
What you need for this learning path
Who this learning path is for
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Module 1
1. Setting up OpenCV
Choosing and using the right setup tools
Making the choice on Windows XP, Windows Vista, Windows 7, or Windows 8
Using binary installers (no support for depth cameras)
Using CMake and compilers
Making the choice on Mac OS X Snow Leopard, Mac OS X Lion, or Mac OS X Mountain Lion
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
Making the choice on Ubuntu 12.04 LTS or Ubuntu 12.10
Using the Ubuntu repository (no support for depth cameras)
Using CMake via a ready-made script that you may customize
Making the choice on other Unix-like systems
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
Reading/Writing a video file
Capturing camera frames
Displaying camera frames in a window
Project concept
An object-oriented design
Abstracting a video stream – managers.CaptureManager
Abstracting a window and keyboard – managers.WindowManager
Applying everything – cameo.Cameo
Summary
3. Filtering Images
Creating modules
Channel mixing – seeing in Technicolor
Simulating RC color space
Simulating RGV color space
Simulating CMV color space
Curves – bending color space
Formulating a curve
Caching and applying a curve
Designing object-oriented curve filters
Emulating photo films
Emulating Kodak Portra
Emulating Fuji Provia
Emulating Fuji Velvia
Emulating cross-processing
Highlighting edges
Custom kernels – getting convoluted
Modifying the application
Summary
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
Swapping faces in one camera feed
Copying faces between camera feeds
Summary
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
A. Integrating with Pygame
Installing Pygame
Documentation and tutorials
Subclassing managers.WindowManager
Modifying the application
Further uses of Pygame
Summary
B. Generating Haar Cascades for Custom Targets
Gathering positive and negative training images
Finding the training executables
On Windows
On Mac, Ubuntu, and other Unix-like systems
Creating the training sets and cascade
Creating <negative_description>
Creating <positive_description>
Creating <binary_description> by running <opencv_createsamples>
Creating <cascade> by running <opencv_traincascade>
Testing and improving <cascade>
Summary
2. Module 2
1. Detecting Edges and Applying Image Filters
2D convolution
Blurring
The size of the kernel versus the blurriness
Edge detection
Motion blur
Under the hood
Sharpening
Understanding the pattern
Embossing
Erosion and dilation
Afterthought
Creating a vignette filter
What's happening underneath?
How do we move the focus around?
Enhancing the contrast in an image
How do we handle color images?
Summary
2. Cartoonizing an Image
Accessing the webcam
Under the hood
Keyboard inputs
Interacting with the application
Mouse inputs
What's happening underneath?
Interacting with a live video stream
How did we do it?
Cartoonizing an image
Deconstructing the code
Summary
3. Detecting and Tracking Different Body Parts
Using Haar cascades to detect things
What are integral images?
Detecting and tracking faces
Understanding it better
Fun with faces
Under the hood
Detecting eyes
Afterthought
Fun with eyes
Positioning the sunglasses
Detecting ears
Detecting a mouth
It's time for a moustache
Detecting a nose
Detecting pupils
Deconstructing the code
Summary
4. 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
5. Creating a Panoramic Image
Matching keypoint descriptors
How did we match the keypoints?
Understanding the matcher object
Drawing the matching keypoints
Creating the panoramic image
Finding the overlapping regions
Stitching the images
What if the images are at an angle to each other?
Why does it look stretched?
Summary
6. 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?
How did we do it?
Summary
7. 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?
How does it work?
Watershed algorithm
Summary
8. Object Tracking
Frame differencing
Colorspace based tracking
Building an interactive object tracker
Feature based tracking
Background subtraction
Summary
9. 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?
What if we cannot separate the data with simple straight lines?
How do we actually implement this?
What happened inside the code?
How did we build the trainer?
Summary
10. Stereo Vision and 3D Reconstruction
What is stereo correspondence?
What is epipolar geometry?
Why are the lines different as compared to SIFT?
Building the 3D map
Summary
11. 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?
What happened inside the code?
How to augment our reality?
Mapping coordinates from 3D to 2D
How to overlay 3D objects on a video?
Let's look at the code
Let's add some movements
Summary
3. Module 3
1. Fun with Filters
Planning the app
Creating a black-and-white pencil sketch
Implementing dodging and burning in OpenCV
Pencil sketch transformation
Generating a warmin...

Table of contents