OpenCV 3 Computer Vision with Python Cookbook

Recipe-based approach to tackle the most common problems in Computer Vision by leveraging the functionality of OpenCV using Python APIs
Preview in Mapt

OpenCV 3 Computer Vision with Python Cookbook

Alexey Spizhevoy, Aleksandr Rybnikov
New Release!

Recipe-based approach to tackle the most common problems in Computer Vision by leveraging the functionality of OpenCV using Python APIs
Mapt Subscription
FREE
€29.98/m after trial
eBook
€25.20
RRP €35.98
Save 29%
Print + eBook
€37.99
RRP €37.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
€0.00
€25.20
€37.99
€29.99 p/m after trial
RRP €35.98
RRP €37.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


OpenCV 3 Computer Vision with Python Cookbook Book Cover
OpenCV 3 Computer Vision with Python Cookbook
€ 35.98
€ 25.20
Learning Neo4j Book Cover
Learning Neo4j
€ 26.38
€ 2.64
Buy 2 for €20.50
Save €34.89
Add to Cart

Book Details

ISBN 139781788474443
Paperback306 pages

Book Description

OpenCV 3 is a native cross-platform library for computer vision, machine learning, and image processing. OpenCV's convenient high-level APIs hide very powerful internals designed for computational efficiency that can take advantage of multicore and GPU processing. This book will help you tackle increasingly challenging computer vision problems by providing a number of recipes that you can use to improve your applications.

In this book, you will learn how to process an image by manipulating pixels and analyze an image using histograms. Then, we'll show you how to apply image filters to enhance image content and exploit the image geometry in order to relay different views of a pictured scene. We’ll explore techniques to achieve camera calibration and perform a multiple-view analysis.

Later, you’ll work on reconstructing a 3D scene from images, converting low-level pixel information to high-level concepts for applications such as object detection and recognition. You’ll also discover how to process video from files or cameras and how to detect and track moving objects. Finally, you'll get acquainted with recent approaches in deep learning and neural networks.

By the end of the book, you’ll be able to apply your skills in OpenCV to create computer vision applications in various domains.

Table of Contents

Chapter 1: I/O and GUI
Introduction
Reading images from files
Simple image transformationsβ€”resizing and flipping
Saving images using lossy and lossless compression
Showing images in an OpenCV window
Working with UI elements, such as buttons and trackbars, in an OpenCV window
Drawing 2D primitivesβ€”markers, lines, ellipses, rectangles, and text
Handling user input from a keyboard
Making your app interactive through handling user input from a mouse
Capturing and showing frames from a camera
Playing frame stream from video
Obtaining a frame stream properties
Writing a frame stream into video
Jumping between frames in video files
Chapter 2: Matrices, Colors, and Filters
Introduction
Manipulating matrices-creating, filling, accessing elements, and ROIs
Converting between different data types and scaling values
Non-image data persistence using NumPy
Manipulating image channels
Converting images from one color space to another
Gamma correction and per-element math
Mean/variance image normalization
Computing image histograms
Equalizing image histograms
Removing noise using Gaussian, median, and bilateral filters
Computing gradients using Sobel operator
Creating and applying your own filter
Processing images with real-valued Gabor filters
Going from the spatial domain to the frequency domain (and back) using the discrete Fourier transform
Manipulating image frequencies for image filtration
Processing images with different thresholds
Morphological operators
Image masks and binary operations
Chapter 3: Contours and Segmentation
Introduction
Binarization of grayscale images using the Otsu algorithm
Finding external and internal contours in a binary image
Extracting connected components from a binary image
Fitting lines and circles into two-dimensional point sets
Calculating image moments
Working with curves - approximation, length, and area
Checking whether a point is within a contour
Computing distance maps
Image segmentation using the k-means algorithm
Image segmentation using segment seeds - the watershed algorithm
Chapter 4: Object Detection and Machine Learning
Introduction
Obtaining an object mask using the GrabCut algorithm
Finding edges using the Canny algorithm
Detecting lines and circles using the Hough transform
Finding objects via template matching
The medial flow tracker
Tracking objects using different algorithms via the tracking API
Computing the dense optical flow between two frames
Detecting chessboard and circle grid patterns
A simple pedestrian detector using the SVM model
Optical character recognition using different machine learning models
Detecting faces using Haar/LBP cascades
Detecting AruCo patterns for AR applications
Detecting text in natural scenes
QR code detector
Chapter 5: Deep Learning
Introduction
Representing images as tensors/blobs
Loading deep learning models from Caffe, Torch, and TensorFlow formats
Getting input and output tensors' shapes for all layers
Preprocessing images and inference in convolutional networks
Measuring inference time and contributions to it from each layer
Classifying images with GoogleNet/Inception and ResNet models
Detecting objects with the Single Shot Detection (SSD) model
Segmenting a scene using the Fully Convolutional Network (FCN) model
Face detection using Single Shot Detection (SSD) and the ResNet model
Age and gender prediction
Chapter 6: Linear Algebra
Introduction
The orthogonal Procrustes problem
Rank-constrained matrix approximation
Principal component analysis
Solving systems of linear equations (including under- and over-determined)
Solving polynomial equations
Linear programming with the simplex method
Chapter 7: Detectors and Descriptors
Introduction
Finding corners in an image - Harris and FAST
Selecting good corners in an image for tracking
Drawing keypoints, descriptors, and matches
Detecting scale invariant keypoints
Computing descriptors for image keypoints - SURF, BRIEF, ORB
Matching techniques for finding correspondences between descriptors
Finding reliable matches - cross-check and ratio test
Model-based filtering of matches - RANSAC
BoW model for constructing global image descriptors
Chapter 8: Image and Video Processing
Introduction
Warping an image using affine and perspective transformations
Remapping an image using arbitrary transformation
Tracking keypoints between frames using the Lucas-Kanade algorithm
Background subtraction
Stitching many images into panorama
Denoising a photo using non-local means algorithms
Constructing an HDR image
Removing defects from a photo with image inpainting
Chapter 9: Multiple View Geometry
Introduction
Pinhole camera model calibration
Fisheye camera model calibration
Stereo rig calibration - estimation of extrinsics
Distorting and undistorting points
Removing lens distortion effects from an image
Restoring a 3D point from two observations through triangulation
Finding a relative camera-object pose through the PnP algorithm
Aligning two views through stereo rectification
Epipolar geometry - computing fundamental and essential matrices
Essential matrix decomposition into rotation and translation
Estimating disparity maps for stereo images
Special case 2-view geometry - estimating homography transformation
Planar scene - decomposing homography into rotation and translation
Rotational camera case - estimating camera rotation from homography

What You Will Learn

  • Get familiar with low-level image processing methods
  • See the common linear algebra tools needed in computer vision
  • Work with different camera models and epipolar geometry
  • Find out how to detect interesting points in images and compare them
  • Binarize images and mask out regions of interest
  • Detect objects and track them in videos

Authors

Table of Contents

Chapter 1: I/O and GUI
Introduction
Reading images from files
Simple image transformationsβ€”resizing and flipping
Saving images using lossy and lossless compression
Showing images in an OpenCV window
Working with UI elements, such as buttons and trackbars, in an OpenCV window
Drawing 2D primitivesβ€”markers, lines, ellipses, rectangles, and text
Handling user input from a keyboard
Making your app interactive through handling user input from a mouse
Capturing and showing frames from a camera
Playing frame stream from video
Obtaining a frame stream properties
Writing a frame stream into video
Jumping between frames in video files
Chapter 2: Matrices, Colors, and Filters
Introduction
Manipulating matrices-creating, filling, accessing elements, and ROIs
Converting between different data types and scaling values
Non-image data persistence using NumPy
Manipulating image channels
Converting images from one color space to another
Gamma correction and per-element math
Mean/variance image normalization
Computing image histograms
Equalizing image histograms
Removing noise using Gaussian, median, and bilateral filters
Computing gradients using Sobel operator
Creating and applying your own filter
Processing images with real-valued Gabor filters
Going from the spatial domain to the frequency domain (and back) using the discrete Fourier transform
Manipulating image frequencies for image filtration
Processing images with different thresholds
Morphological operators
Image masks and binary operations
Chapter 3: Contours and Segmentation
Introduction
Binarization of grayscale images using the Otsu algorithm
Finding external and internal contours in a binary image
Extracting connected components from a binary image
Fitting lines and circles into two-dimensional point sets
Calculating image moments
Working with curves - approximation, length, and area
Checking whether a point is within a contour
Computing distance maps
Image segmentation using the k-means algorithm
Image segmentation using segment seeds - the watershed algorithm
Chapter 4: Object Detection and Machine Learning
Introduction
Obtaining an object mask using the GrabCut algorithm
Finding edges using the Canny algorithm
Detecting lines and circles using the Hough transform
Finding objects via template matching
The medial flow tracker
Tracking objects using different algorithms via the tracking API
Computing the dense optical flow between two frames
Detecting chessboard and circle grid patterns
A simple pedestrian detector using the SVM model
Optical character recognition using different machine learning models
Detecting faces using Haar/LBP cascades
Detecting AruCo patterns for AR applications
Detecting text in natural scenes
QR code detector
Chapter 5: Deep Learning
Introduction
Representing images as tensors/blobs
Loading deep learning models from Caffe, Torch, and TensorFlow formats
Getting input and output tensors' shapes for all layers
Preprocessing images and inference in convolutional networks
Measuring inference time and contributions to it from each layer
Classifying images with GoogleNet/Inception and ResNet models
Detecting objects with the Single Shot Detection (SSD) model
Segmenting a scene using the Fully Convolutional Network (FCN) model
Face detection using Single Shot Detection (SSD) and the ResNet model
Age and gender prediction
Chapter 6: Linear Algebra
Introduction
The orthogonal Procrustes problem
Rank-constrained matrix approximation
Principal component analysis
Solving systems of linear equations (including under- and over-determined)
Solving polynomial equations
Linear programming with the simplex method
Chapter 7: Detectors and Descriptors
Introduction
Finding corners in an image - Harris and FAST
Selecting good corners in an image for tracking
Drawing keypoints, descriptors, and matches
Detecting scale invariant keypoints
Computing descriptors for image keypoints - SURF, BRIEF, ORB
Matching techniques for finding correspondences between descriptors
Finding reliable matches - cross-check and ratio test
Model-based filtering of matches - RANSAC
BoW model for constructing global image descriptors
Chapter 8: Image and Video Processing
Introduction
Warping an image using affine and perspective transformations
Remapping an image using arbitrary transformation
Tracking keypoints between frames using the Lucas-Kanade algorithm
Background subtraction
Stitching many images into panorama
Denoising a photo using non-local means algorithms
Constructing an HDR image
Removing defects from a photo with image inpainting
Chapter 9: Multiple View Geometry
Introduction
Pinhole camera model calibration
Fisheye camera model calibration
Stereo rig calibration - estimation of extrinsics
Distorting and undistorting points
Removing lens distortion effects from an image
Restoring a 3D point from two observations through triangulation
Finding a relative camera-object pose through the PnP algorithm
Aligning two views through stereo rectification
Epipolar geometry - computing fundamental and essential matrices
Essential matrix decomposition into rotation and translation
Estimating disparity maps for stereo images
Special case 2-view geometry - estimating homography transformation
Planar scene - decomposing homography into rotation and translation
Rotational camera case - estimating camera rotation from homography

Book Details

ISBN 139781788474443
Paperback306 pages
Read More

Read More Reviews

Recommended for You

Learning Neo4j Book Cover
Learning Neo4j
€ 26.38
€ 2.64
Computer Vision with OpenCV 3 and Qt5 Book Cover
Computer Vision with OpenCV 3 and Qt5
€ 45.58
€ 31.92
Learning OpenCV 3 Computer Vision with Python - Second Edition Book Cover
Learning OpenCV 3 Computer Vision with Python - Second Edition
€ 39.58
€ 27.72
Building Advanced OpenCV3 Projects with Python [Video] Book Cover
Building Advanced OpenCV3 Projects with Python [Video]
€ 125.98
€ 107.10
OpenCV: Computer Vision Projects with Python Book Cover
OpenCV: Computer Vision Projects with Python
€ 67.18
€ 47.04
OpenCV 3.x with Python By Example - Second Edition Book Cover
OpenCV 3.x with Python By Example - Second Edition
€ 35.98
€ 25.20