Computer Vision Using OpenCV

Rate this content
Bookmark

As an AI scientist and a developer, I have been engaged with AI-applications for many years especially focusing on object detection and recognition purposes. I love thinking that we can get creative in designing neural networks. We can train them supervised, unsupervised, semi or self-supervised, and this gives possibilities to mimic the human brain in a narrow domain. However, in vision applications, there are still things where AI is lacking and will be lacking without computer vision knowledge. Computer vision has been solving detection and recognition problems for many years. However, in the last decade, it seems like AI is seen as a replacement of computer vision. AI can find the optimal model for a specific type of data set and it might achieve generalization better. AI can be designed in a way that it can learn life-long which also brings possibilities of creating models which serve better when they are used longer. However, an AI vision system will be lacking capabilities without computer vision knowledge. First of all, it will require a very big data set to train the model what can be expensive or even not possible. On the other hand, computer vision systems can be modeled only using a hand-drawn template image. Training AI models also requires GPUs. Nevertheless, I do not want to encourage everyone to train AI models for solving any simple problem which could be solved easily computer vision. Last but not least, knowing computer vision, machine learning and especially feature engineering methods helps to design hybrid models that might be more robust to adversarial attacks or changing conditions.


In this lecture, I will briefly introduce how computer vision (especially using the OpenCV library) and machine learning can be used for creating detection and recognition models. Some experience with python, jupyter notebook and some machine learning background would be useful to get more benefits from this lecture.

This talk has been presented at ML conf EU 2020, check out the latest edition of this Tech Conference.

FAQ

Image processing involves transforming an input image into a processed version, focusing on enhancing or extracting information from it. Computer vision, on the other hand, uses images to extract specific values or features like the number of people, shapes, or positions, which can then be used for further analysis or decision-making.

Common image processing applications include denoising images, adjusting color balances, image augmentation, background removal, edge and corner detection, and restoring colors in old photos. These techniques are used to improve image quality or prepare images for further processing.

Histogram equalization is a technique used to improve the contrast in images. It involves stretching out the intensity range of the histogram of an image, which redistributes the pixel intensity values and enhances areas that are too dark or too light, making details more visible.

While AI generally learns to identify features from large datasets, computer vision techniques often involve hand-tailored approaches where specific features are manually extracted and analyzed. This can make computer vision more straightforward for certain applications but less adaptable than AI, which can generalize from broader data.

In healthcare, computer vision can be used for tasks such as analyzing medical images to detect and classify diseases, like identifying cancerous tissues in scans, and determining the stage of cancer. These applications assist healthcare professionals in diagnostics by providing additional insights into visual data.

AI algorithms, especially those involving deep learning, typically require powerful hardware like GPUs for efficient processing due to their computational intensity. Computer vision tasks can often be performed on less powerful machines, depending on the complexity and nature of the task.

No, OpenCV stands for Open Computer Vision and is specifically designed for image and video processing. It is not suitable for audio processing, which generally involves different techniques and libraries specifically tailored to handle one-dimensional audio data.

Beril Sirmacek
Beril Sirmacek
32 min
02 Jul, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

The video covers various aspects of computer vision using OpenCV, including image processing techniques and their applications. It explains how histograms are used for segmenting objects and enhancing image contrast through histogram equalization. Methods like OTSU's thresholding and hysteresis thresholding are discussed for object detection and line extraction. The talk highlights the difference between image processing and computer vision, emphasizing that image processing transforms images, while computer vision extracts values or features from them. Practical applications in healthcare, such as cancer detection and stage determination, are also mentioned. The speaker briefly touches on the hardware requirements for AI and computer vision algorithms and clarifies that OpenCV is not suitable for audio processing. The importance of understanding the underlying algorithms for robust and effective debugging is also stressed.

1. Introduction and Image Processing

Short description:

Today, we will explore image processing, computer vision, and the combination of computer vision and machine learning. I will provide examples and a code snippet for computer vision algorithms. I have over 15 years of experience in computer vision, machine learning, and artificial intelligence. Let's start by understanding what an image is.

Hi, everyone. Thank you very much for registering to this machine learning conference. Whether you are located in Europe or anywhere else on the earth. Thanks a lot for being here.

I'm Veril. Today, we are going to see how we can make software, machine learning software, see things like humans do. We will try to introduce some image processing and computer vision topics in this very limited short time. Because of the time limitation, I cannot show you so many programming examples. But within my slides, if you notice I've put some algorithms within boxes. So I hope you can turn back and look around later, that could be useful. And we can discuss more examples may be after the presentation at the Q&A session.

So this is my agenda for today. After a small introduction, I will first introduce you what is image processing, some image processing algorithms, and then we will look at computer vision. And we will see some classical computer vision algorithms. Finally, I want to address how we can combine computer vision and machine learning, and how it is different than regular AI solving all problems by itself. So how is it different? Is computer vision irrelevant now because AI is doing everything by itself? So we will discuss these topics. Lastly, I will give you a piece of code. Again, you can implement yourself to jumpstart into doing some computer vision algorithms, hopefully.

A little bit of introduction about myself. I'm currently an assistant professor at the Swedish University called Jönköping University. It's an AI lab just focusing on developing AI and explainable AI algorithms. Besides, I've got my own company, which has done a lot of computer vision applications in the past in the Netherlands. I'm located in the Netherlands also. I've got experience over 15 years in the area of computer vision, machine learning, and also artificial intelligence is the area where I'm putting my a lot of efforts these days. If I want to introduce myself, I always need to add that I'm an environmentalist.

What is an image? Let's start with what is an image before processing these images. If it's a digital image, we are talking about digital images, not old analog style images. If it's a digital image, we are talking about a matrix. The source can be anything. The source can be your smartphone, a regular camera.

2. Image Processing and Computer Vision

Short description:

If we are talking about digital image, we are talking about a matrix. If we see a picture with a T within it, we can represent this T as an image by putting 1 when it's bright and putting 0 when it's dark. Assume that we talk about the brightness or grayscale image, which is a combination of red, green, blue bands. Image processing and computer vision are different. Image processing software takes an image as input and outputs a processed image. Computer vision takes an image as input and outputs a value, such as the number of people in the scene or a GPS location found in a satellite image.

It can be a satellite sensor. It can be a heat sensor. It can be dermatological or microscopic image, telescope image, whatever. If we are talking about digital image, we are talking about a matrix. Alright, if you've got a matrix, you know how to do matrix operations and welcome to image processing. You know how to do image processing now.

If we see a picture with a T within it, let's say, we can represent this T as an image by putting 1 when it's bright and putting 0 when it's dark. Now we've got T represented as a digital image. When the numbers are only 0 and 1, of course this matrix is a binary matrix. It's a binary image, it's called. But normally when we've got our smartphones make a picture, we've got RGB, red, green, blue color images. So, that means that we don't have one image as a one matrix. For each image, we've got three matrices. But in order to make things, operations simple. Now, we will try to look at one matrix at once.

Assume that we talk about the brightness or grayscale image, which is combination of these red, green, blue bands all together. Let's assume that a weighted sum is obtained. So, before going further, I said I will talk about image processing. I will talk about computer vision. Are they the same thing or not? I say it's the same. Is it true or false? Give an answer from your head now. It's false. Well, even though people use these terms interchangeably, some people say image processing for computer vision, some people can say computer vision for an image processing application, but in fact there are different things. When we say image processing, we assume that we've got a software, which we say image processing software, where the input is an image and output is a processed image, then we've got an image processing software. However, when we are talking about computer vision, then our input again is an image. But the output is a value. It can be a number of people in the scene or a vector, a position, a GPS location that we found in a satellite image, a boundary, a shape. It can be any class, for instance. So if we have a value at the end, then we say we've done computer vision. And most of the time, these are done altogether, because most of the time the image for computer vision is not suitable to process and to be processed immediately.

QnA