Install OpenCV in Ubuntu
What is OpenCV?
OpenCV (stands for open-source computer vision library) is the programming function's library primarily focused on real-time computer vision. It was originally integrated by Intel and later offered by Willow Garage then Itseez (later inherited by Intel). OpenCV is free and cross-platform for use upon the open-source Apache 2 License. It features acceleration of GPU for real-time implementations beginning with 2011.
What is Computer Vision?
Computer vision can be described as a process from which we can know the concept of the videos and images how they are stored and how we can retrieve and manipulate information from them. Computer vision is a base or mostly applied for Artificial Intelligence. It is playing a big role in robotics, self-driving cars, and photo correcting applications as well.
Computer vision is a discipline that describes how to understand, interrupt, and reconstruct a 3D view using its 2D images, regarding the structure properties available in the view. It deals with replicating and modeling human vision with computer hardware and software.
Computer vision can significantly overlap with the below-mentioned fields:
Functionalities of OpenCV
Some important functionalities of OpenCV are mentioned below:
What is Image processing?
It is a method for performing a few operations on any image, to receive an enhanced image, or to extract a few useful information using it. The basic image processing definition can be, "Image processing is the manipulation and analysis of digitized image for improving its quality".
The images may be categorized as a two-dimensional function f(x,y), in which x and y are plane (spatial) coordinates, and the fat amplitude for any co-ordinate pair is known as the grey or intensity level of an image at that particular point.
The images are nothing but the two-dimensional matrix, which is specified by a mathematical function f(x,y) at any particular point, is providing the value of a pixel of the image at that point, the value of that pixel specifies how bright that particular pixel is, and which color it will be.
Basically, image processing is signal processing where the input is known as an image and the outcome is known as characteristics or image according to need related to that image.
Image processing has the below three steps:
History of OpenCV
In 1999, OpenCV was officially launched and it was an initiative of Intel Research to advance applications of CPU-intensive, a series part of projects with 3D display walls and real-time ray tracing. The primary contributors to this project contained several optimization experts in the Performance Library Team and Intel Russia. In the starting time of OpenCV, the project goals were specified as:
In 2000, the first OpenCV alpha version was published to the public at the IEEE Conference on Computer Vision and Pattern Recognition, and 5 betas were published during 2001-2005. In 2006, the initial 1.0 version was published. The 1.1 version "pre-release" was published in October 2008. In October 2009, the second major OpenCV version was released.
OpenCV 2 contains major modifications to the interface of the C++, focusing on better implementations, new functions, more type-safe patterns, and easier for existing ones in contrast to performance (mainly on multi-core systems). Now, official versions appear every 6 months, and improvement is now implemented by the Russian team which is supported by technical corporations.
For OpenCV, the support was taken over via a non-profit foundation which is known as OpenCV.org in August 2012. This Foundation manages a user and developer site.
Intel sealed an agreement for acquiring Itseez which is a leading OpenCV developer in May 2016.
OpenCV disclosed and started a Kickstarter Campaign for OpenCV AI Kit which is a hardware module series and inclusions to OpenCV supporting AI.
Applications of OpenCV
The application areas of OpenCV include:
For supporting a few of the above-mentioned areas, Open CV has a statical library for machine learning that includes:
Programming language of OpenCV
OpenCV is specified in the C++ language and its main interface is inside this language, but it still has a less broad though the extensive older interface of C. Every new algorithm and development occurs in the C++ interface. There are several bindings in MATLAB/OCTAVE, Java, and Python. The API for the interfaces could be detected in the online documentation.
OS support in OpenCV
OpenCV executes on many desktop OSes. Some of these are mentioned below:
OpenCV also runs on several mobile OSes which are mentioned below:
The users can receive official versions from SourceForge or get the latest sources using GitHub. Also, OpenCV applies the concept of CMake.
When the library detects the Integrated Performance Primitives of Intel on the computer, it will apply this proprietary routine for accelerating itself:
Installing OpenCV in Ubuntu
As we explained above, OpenCV is a computer vision library that stands for Open-Source Computer Vision Library. In this abbreviation, open defines an open-source library along with bindings for Java, C++, and python and supports distinct types of operating systems such as Linux and Windows.
It can use GPU acceleration and multi-core processing for real-time operating operations. The library of OpenCV can be used for a number of applications including medical image analysis, 3D model extraction, face detection and recognition, surveillance video, motion tracking, and much more.
We will explain how we can install OpenCV in the 20.04 version of Ubuntu in this article.
Installing OpenCV with Ubuntu Repository
In the 20.04 version of Ubuntu, the library of OpenCV is available inside the official Ubuntu repository. First of all, we need to update our apt cache by entering the following command in the terminal window:
Then, we will install OpenCV by executing the following command in the terminal window:
This command will help us to install every necessary package on our system.
After finishing the installation process of OpenCV, we can also verify the installation process by importing the module, i.e., cv2, and print the installed OpenCV version by running the following command in the terminal window: