Free Sample
+ Collection

OpenCV 2 Computer Vision Application Programming Cookbook

Robert Laganière

If you have at least some basic knowledge of C++, this book will teach you how to write computer vision applications for the modern world. The recipe-based approach comes with explanations and screenshots for easy learning.
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849513241
Paperback304 pages

About This Book

  • Teaches you how to program computer vision applications in C++ using the different features of the OpenCV library
  • Demonstrates the important structures and functions of OpenCV in detail with complete working examples
  • Describes fundamental concepts in computer vision and image processing
  • Gives you advice and tips to create more effective object-oriented computer vision programs
  • Contains examples with source code and shows results obtained on real images with detailed explanations and the required screenshots


Who This Book Is For

If you are a novice C++ programmer who wants to learn how to use the OpenCV library to build computer vision applications, then this cookbook is appropriate for you. It is also suitable for professional software developers wishing to be introduced to the concepts of computer vision programming. It can be used as a companion book in university-level computer vision courses. It constitutes an excellent reference for graduate students and researchers in image processing and computer vision. The book provides a good combination of basic to advanced recipes. Basic knowledge of C++ is required.

Table of Contents

Chapter 1: Playing with Images
Installing the OpenCV library
Creating an OpenCV project with MS Visual C++
Creating an OpenCV project with Qt
Loading, displaying, and saving images
Creating a GUI application using Qt
Chapter 2: Manipulating the Pixels
Accessing pixel values
Scanning an image with pointers
Scanning an image with iterators
Writing efficient image scanning loops
Scanning an image with neighbor access
Performing simple image arithmetic
Defining regions of interest
Chapter 3: Processing Images with Classes
Using the Strategy pattern in algorithm design
Using a Controller to communicate with processing modules
Using the Singleton design pattern
Using the Model-View-Controller architecture to design an application
Converting color spaces
Chapter 4: Counting the Pixels with Histograms
Computing the image histogram
Applying look-up tables to modify image appearance
Equalizing the image histogram
Backprojecting a histogram to detect specific image content
Using the mean shift algorithm to find an object
Retrieving similar images using histogram comparison
Chapter 5: Transforming Images with Morphological Operations
Eroding and dilating images using morphological filters
Opening and closing images using morphological filters
Detecting edges and corners using morphological filters
Segmenting images using watersheds
Extracting foreground objects with the GrabCut algorithm
Chapter 6: Filtering the Images
Filtering images using low-pass filters
Filtering images using a median filter
Applying directional filters to detect edges
Computing the Laplacian of an image
Chapter 7: Extracting Lines, Contours, and Components
Detecting image contours with the Canny operator
Detecting lines in images with the Hough transform
Fitting a line to a set of points
Extracting the components' contours
Computing components' shape descriptors
Chapter 8: Detecting and Matching Interest Points
Detecting Harris corners
Detecting FAST features
Detecting the scale-invariant SURF features
Describing SURF features
Chapter 9: Estimating Projective Relations in Images
Calibrating a camera
Computing the fundamental matrix of an image pair
Matching images using random sample consensus
Computing a homography between two images
Chapter 10: Processing Video Sequences
Reading video sequences
Processing the video frames
Writing video sequences
Tracking feature points in video
Extracting the foreground objects in video

What You Will Learn

  • Create advanced computer vision applications using sound object-oriented programming practices
  • Iterate over an image to process each of its pixels
  • Enhance an image or interesting parts of an image using histograms
  • Use mathematical morphology to process binary images and to segment images into homogenous regions
  • Filter images by modifying their frequency content
  • Detect the lines, contours , and objects contained in an image
  • Apply different interest point operators in order to characterize an image content
  • Exploit the image geometry in order to match different views of a pictured scene
  • Calibrate the camera from different image observations
  • Reconstruct selected image elements in 3D

In Detail

In today's digital world, images are everywhere, and with the advent of powerful and affordable computing devices, it has become possible to create sophisticated applications manipulating images and videos. Adding special effects, enhancing image features, performing object recognition, and reconstructing 3D information are tasks that can be programmed easily with the OpenCV library, which is a widely used open source library that offers a rich set of advanced computer vision algorithms.

OpenCV 2 Computer Vision Application Programming Cookbook will introduce you to numerous computer vision algorithms included in the OpenCV library. You will learn how to read, write, create and manipulate images. You will explore different techniques commonly used in image analysis and how they can be effectively implemented in C++. The book provides a complete introduction to the OpenCV library and explains how to build your first computer vision program. You will be presented with a variety of computer vision algorithms and be exposed to important concepts in image analysis that will enable you to build your own computer vision applications.

The book helps you to get started with the library, showing you how to install and deploy the OpenCV library to write effective computer vision applications following good programming practices. The techniques to process an image and its pixels using the data structures offered by the library are explained in detail. You will learn how to build and manipulate an image histogram; how to detect lines and contours. You will be introduced to the concept of mathematical morphology and image filtering. The detection and use of interest points in computer vision is presented with applications for image matching and object recognition. Techniques to achieve camera calibration and 3D reconstruction are presented.

OpenCV 2 Computer Vision Application Programming Cookbook is your guide to the development of computer vision applications. It is a comprehensive reference that exposes you to computer vision concepts illustrated with extensive examples.


Read More