Computer Vision

 


Computer vision is an area that seeks to facilitate how a computer understands images or videos, through this, it is intended that they focus on performing tasks that humans perform such as object detection, automatic inspection, car navigation, etc. For the present practice we focus only on one area, the motion detection and the subtraction of the background of a video in real time, this without making use of the high-level function that openCV provides.


C++


C++ is a cross-platform language that can be used to create high-performance applications.
C++ was developed by Bjarne Stroustrup, as an extension to the C language.
C++ gives programmers a high level of control over system resources and memory.
The language was updated 3 major times in 2011, 2014, and 2017 to C++11, C++14, and C++17.


Why Use C++

 

C++ is one of the world's most popular programming languages.

C++ can be found in today's operating systems, Graphical User Interfaces, and embedded systems.

C++ is an object-oriented programming language which gives a clear structure to programs and allows code to be reused, lowering development costs.

C++ is portable and can be used to develop applications that can be adapted to multiple platforms.

C++ is fun and easy to learn!

As C++ is close to C# and Java, it makes it easy for programmers to switch to C++ or vice versa





OpenCV

OpenCV is an open-source C++ library for image processing and computer vision, originally developed by Intel, later supported by Willow Garage and is now maintained by Itseez. It is free for both commercial and non-commercial use. Therefore, you can use the OpenCV library even for your commercial applications. It is a library mainly aimed at real time processing. Now it has several hundreds of inbuilt functions which implement image processing and computer vision algorithms which make developing advanced computer vision applications easy and efficient.


 video introduction




Phases of the algorithm

 

 

1.   Acquisition of videos:

 




The first step of the algorithm is to obtain a video either by reading a locally stored file and also through the use of peripherals, in this case, a camera.

 

2 .Pseudo Image Processing:

 

We call this step pseudo because we only transform the input frames to grayscale, in this way, improve performance and the way in which it is going to work, since there will only be a single channel for the information.


3. Subtraction of the original image vs the new image:

 

To obtain the movement of an image, we subtract a previous frame against the next frame, in order to obtain the edges of the object that was moved.

 

4.Background subtraction and video montage:

 

When we already have the movement of an image, we proceed to replace the data that are inside the edges with the video of the original frame in order to obtain the object that moved in color, while what did not move will be mounted by a video chosen by our group, in our case a video of the Halo game.

 

5. Filters and variables:

 

As mentioned above, the goal of this project is to add a background video to the camera video, as accurately as possible using algorithms made by hand by ourselves. To achieve this objective, we had to be guided by filters and variables. By this, we made the results such as image subtraction, edge detection, and image reconstruction as smooth as possible. By means of it, I made the use of filters such as Gaussian among others that provide us with better results instead of working directly with the data.

 

 

Results of the project


 Face Detector



background video and face detector



In this video we can see how it is possible to mount a video as a background, this was achieved thanks to the use of some types of filters and adjustment of variable values such as threshold. For example, with a high threshold it is more difficult for movement to be detected, while with a very low one there will be more noise. Therefore, a middle state between the two must be sought.


Conclusions:

To conclude with the practice, we can say that OpenCV together with C ++ are one of the best options for computer vision. This is possible thanks to the speed of C ++ and how optimized OpenCV is to solve problems without much effort.

We can also conclude the importance of learning the fundamental parts of any tool before using it, since there is a tool called backgroundsubtract that allows us to carry out the same work of this practice obtaining better results, the problem is that when we use it we do not know what happens from behind.



Bibliography :

Kaehler, A., & Bradski, G. (2016). Learning OpenCV 3: computer vision in C++ with the OpenCV library. " O'Reilly Media, Inc.".


made by: Kevin Godoy - William Chabla



Comentarios