OpenCV is a library of programming functions mainly aimed at real-time computer vision. In simple language, it is one of the most powerful library used for image processing. If you wish to learn how to do image processing with OpenCV, then go for this Learning Path.
Packt’s Video Learning Path is a series of individual video products put together in a logical and stepwise manner such that each video builds on the skills learned in the video before it.
This Learning Path begins with setting up OpenCV library on your system. Then, you will learn how to read and display images. You will also be introduced to basic OpenCV data structures. You will learn how to manipulate pixels and how an image can be read. Also, you will explore different methods to scan an image in order to perform operation on each of its pixels. Next, you will learn how to process the colors of an image where you’ll be presented with various object-oriented design patterns that will help you build better computer vision applications. Also, you will discover how to count pixels with histograms and compute image histograms.
Moving ahead, you will learn different techniques for image enhancement and shape analysis. You will be introduced to the concepts of mathematical morphology and image filtering. Finally, you will learn techniques to achieve camera calibration and perform multiple-view analysis.
By the end of this Learning Path, you will learn to build your own computer vision applications in no time!
About the Author:
For this course, we have combined the best works of this esteemed author:
Robert Laganiere is a professor at the School of Electrical Engineering and Computer Science of the University of Ottawa, Canada. He is also a faculty member of the VIVA research lab and is the co-author of several scientific publications and patents in content-based video analysis, visual surveillance, driver-assistance, object detection, and tracking. Robert authored the OpenCV2 Computer Vision Application Programming Cookbook in 2011 and co-authored Object Oriented Software Development, published by McGraw Hill in 2001. He co-founded Visual Cortek in 2006, an Ottawa-based video analytics startup that was later acquired by in 2009. He is also a consultant in computer vision and has assumed the role of Chief Scientist in a number of startups companies such as Cognivue Corp, iWatchlife, and Tempo Analytics.
This video will show you how to install the library on your machine.
OpenCV is about processing images, this task will show you how to perform the most fundamental operations needed in the development of imaging applications.
It is used to manipulate images and matrices in fact, an image is a matrix from a computational and mathematical point of view. Since you will be using this data structure extensively in your application development processes, it is imperative that you become familiar with it.
Sometimes, a processing function needs to be applied only to a portion of an image. OpenCV incorporates an elegant and simple mechanism to define a sub region in an image and manipulate it as a regular image.
In order to access each individual element of a matrix, you just need to specify its row and column numbers. The corresponding element, which can be a single numerical value or a vector of values in the case of a multi-channel image, will be returned.
In most image-processing tasks, you need to scan all pixels of the image in order to perform a computation. Considering the large number of pixels that will need to be visited, it is essential that you perform this task in an efficient way.
Iterators are specialized classes that are built to go over each element of a collection, hiding how the iteration over each element is specifically done for a given collection. This application of the information-hiding principle makes scanning a collection easier and safer.
When you write an image-processing function, efficiency is often a concern. When you design your function, you will frequently need to check the computational efficiency of your code in order to detect any bottleneck in your processing that might slow down your program.
In image processing, it is common to have a processing function that computes a value at each pixel location based on the value of the neighboring pixels. When this neighborhood includes pixels of the previous and next lines, you then need to simultaneously scan several lines of the image.
Images can be combined in different ways. Since they are regular matrices, they can be added, subtracted, multiplied, or divided. OpenCV offers various image arithmetic operators, and their use is shown in this video
The pixel values are not changed by this process; it is rather the position of each pixel that is remapped to a new location. This is useful in order to create special effects on an image or to correct image distortions caused, for example, by a lens.
Let's say we want to build a simple algorithm that will identify all of the pixels in an image that have a given color. For this, the algorithm has to accept an image and a color as input and will return a binary image showing the pixels that have the specified color. The tolerance with which we want to accept a color will be another parameter to be specified before running the algorithm.
Objects often have distinctive colors, and these ones can often be extracted by identifying areas of similar colors. OpenCV proposes an implementation of a popular algorithm for image segmentation: the GrabCut algorithm.
Computing the distance between the colors using the RGB color space is not the best way to measure the similarity between two given colors. Indeed, RGB is not a perceptually uniform color space. This means that two colors at a given distance might look very similar, while two other colors separated by the same distance might look very different.
A color space based on the concept of hue, saturation, and brightness has then been introduced to help users to specify the colors using properties that are more intuitive to them. In this video, we will explore the concepts of hue, saturation, and brightness as a means to describe colors.
A histogram is a simple table that gives you the number of pixels that have a given value in an image. The histogram of a gray-level image will, therefore, have 256 entries.
We will learn how we can use a simple mapping function, represented by a look-up table, to modify the pixel values of an image. As we will see, look-up tables are often produced from histogram distributions.
One possible way to improve the quality of an image could therefore be to make equal use of all available pixel intensities. This is the idea behind the concept of histogram equalization that is making the image histogram as flat as possible.
You will learn how the concept of histogram backprojection can be advantageously used to detect specific image content.
We will learn about mean shift algorithm to find the exact object location.
Content-based image retrieval is an important problem in computer vision. It consists of finding a set of images that present content that is similar to a given query image.
Now, suppose you have to compute several such histograms over multiple regions of interest inside your image. All these computations could rapidly become very costly. In such a situation, there is a tool that can drastically improve the efficiency of counting pixels over image sub regions: the integral image.
The ability to present the erosion and dilation of morphological operators.
Define other operators to clean up an image before extracting its connected components.
The ability to present two morphological operators that can lead to the detection of interesting image features.
Learn to use the topological map analogy in the description of the watershed algorithm.
The ability to extract MSER.
Learn to present some basic low-pass filters.
The ability to reduce the size of an image.
Learn to use median filter to filter images.
Perform the opposite transformation to amplify the high-frequency content of an image.
The ability to compute the second-order derivatives to measure the curvature of the image function.
The ability to detect the unnecessarily thick edges and detect all important edges of an image.
Learn to detect lines in images and detect other simple image structures.
Learn how to estimate the exact line that best fits a given set of points.
The ability to extract the objects that are contained in this collection of 1s and 0s.
Learn to identify the object or to compare it with other image elements. It can be useful to perform some measurements on the component in order to extract some of its characteristics
Packt has been committed to developer learning since 2004. A lot has changed in software since then - but Packt has remained responsive to these changes, continuing to look forward at the trends and tools defining the way we work and live. And how to put them to work.
With an extensive library of content - more than 4000 books and video courses -Packt's mission is to help developers stay relevant in a rapidly changing world. From new web frameworks and programming languages, to cutting edge data analytics, and DevOps, Packt takes software professionals in every field to what's important to them now.
From skills that will help you to develop and future proof your career to immediate solutions to every day tech challenges, Packt is a go-to resource to make you a better, smarter developer.
Packt Udemy courses continue this tradition, bringing you comprehensive yet concise video courses straight from the experts.