Python | Introduction and Installation of OpenCv

In this tutorial, we are learning about what is OpenCv and how OpenCV is installed in windows/linux system.


Have you ever seen Facebook’s auto-tag feature? Whenever you add an image on Facebook, it consequently labels those who are there within the image. Ever considered how that occurred. It happens all as a result of Computer Vision. OpenCv is a library which is utilized to recognize faces and distinguish them. Facebook’s auto-tag feature is one of the many examples where face recognition algorithm is used. Another instance is face unlock characteristic in our mobile phones. This feature uses Computer Vision to pick out and confirm humans by analyzing the unique features of their face.

Computer Vision

Computer Vision is a field that includes a technique for procuring, preparing, analyzing, and understanding images and finding concealed data in the picture. It copies the capacities of human vision by electronically perceiving and understanding an image
In the simplest terms, computer vision is the discipline of "teaching machines how to see."

It is a field of artificial intelligence that trains computers to decipher and comprehend the visual world. Utilizing pictures from cameras and recordings and deep learning models, machines can precisely recognize and characterize objects — and afterwards, respond to what they "see."

How computer vision works ?
Computer vision works in three basic steps:

1) Acquiring an image

Pictures, even huge sets, can be procured progressively through video, photographs or 3D technology for analysis.

2) Processing the image

Deep learning models automate lots of this process, however, the models are frequently trained by first being fed hundreds of categorized or pre-recognized pictures.

3) Understanding the image

The final step is the interpretative step, in which an object is identified or classified.


1) Sports – Hawk Eye

Hawk-Eye is a computer machine used in several sports together with cricket, tennis, etc., to visually observe the trajectory of the ball and display a profile of its statistically most likely direction as a shifting image.

2) Smart cars

Computer Vision in independent vehicles can prompt the planning and improvement of cutting edge and next-gen vehicles that could conquer riding limitations while guarding travellers. Such automobiles can delivery passengers to their destination wiping out human mediation.


OpenCV is the enormous open-source library for the computer vision, AI, and image processing and now it plays a main position in real-time operation which is very essential in today’s systems. By the usage of it, you’ll be able to process images and motion pictures to perceive objects, faces, or even handwriting of a human. When it included with various libraries, together with Numpy, python is capable of processing the OpenCV array structure for analysis. To Identify image pattern and its various features we use vector space and perform mathematical operations on these features.

The first OpenCV version was 1.0. OpenCV is launched beneath a BSD license and subsequently, it’s free for both educational and industrial use. It has C++, C, Python and Java interfaces and supports Windows, Linux, Mac OS, iOS and Android. When OpenCV was designed the primary focus was real-time applications for computational efficiency. Everything is written in optimized C/C++ to take advantage of multi-core processing.

To install OpenCV, one must have Python and PIP, preinstalled on their system. To check if your system already contains Python, go through the following instructions:

Insall openCV on windows and linux

If you are using Windows then open the Command line(search for cmd in the Run dialogue (Windows Symbol + R). Or else open terminal in Ubuntu with Open the Ctrl+Alt+T
Now run the following command:

If Python is already installed, it will show a message with the Python version available.

PIP is the standard package manager for Python. We can use pip to install extra packages that are not available in the Python standard library.
PIP comes pre-installed on the Python versions 3.4 or older. To check if PIP is already installed on your system, just go to the command line and execute the following command:

Downloading and Installing OpenCV:

To install OpenCV, just go to the command-line and type the following command:

To check if OpenCV is correctly installed, just run the following commands to perform a version check:

If you are using Anaconda in that case:
Open the anaconda command prompt and type in below command.

That’s all about introduction and installation of opencv in Python.


You may also like:

Related Posts

  • Convert image to grayscale in Python
    21 August

    Convert image to grayscale in python

    Table of ContentsUsing the .convert() function from the Pillow Imaging Library (Fork) to convert image to grayscale in Python.Using the OpenCV library functions to convert image to grayscale in Python.Using the color.rgb2gray() function from the scikit-image module to convert image to grayscale in Python.Using the Conversion Formula along with the matplotlib library to convert image […]

  • Rotate image Python
    20 August

    Rotate image in Python

    Table of ContentsUsing the image.rotate() function from the Pillow Imaging Library (Fork) to rotate image in Python.Using NumPy library functions to rotate image in Python.Using the OpenCV and imutils library functions to rotate image in Python.Using matplotlib and SciPy libraries to rotate image in Python. Python supports the use of images and sometimes a given […]

  • 09 August

    Python | cv2 imshow() Method

    Table of ContentsSyntaxParametersReturn ValueReturn value In this tutorial, we will see how to display an image as an output using python by the use of open-cv which is exist as cv2 (computer vision) library. We can use imshow() method of cv2 library to display an image in a window. In order to use cv2 library, […]

  • 09 August

    Python | cv2 imwrite() Method

    Table of ContentsSyntaxParametersReturn Valuecv2 imwrite() method Examples In this tutorial, we will see how to save an image in your own system using python by using open-cv which exists as cv2 (computer vision) library. You can use imwrite() method of cv2 library to save an image on your system. To use cv2 library, you need […]

  • 23 May

    Python | cv2 findContours() Method

    Table of ContentsSyntaxParametersReturn ValueContours Approximation Methodcv2 findContours() Method examplesExample 1: Using cv2.RETR_TREE as a retrieval mode and cv2.CHAIN_APPROX_NONE as a Contour approximation method.Example 2: Using cv2.RETR_EXTERNAL as a Contour retrieval mode and cv2.CHAIN_APPROX_SIMPLE as a Contour approximation method.Reference In this tutorial, we will see how to find all boundary points(x,y) of an object in the […]

  • 23 May

    Python | cv2 threshold() Method

    Table of ContentsSyntaxParametersReturn Valuecv2 threshold() Method examplesExample 1: Using cv2.THRESH_BINARY thresholding technique.Example 2 : Using cv2.THRESH_BINARY_INV thresholding technique. In this tutorial, we will see how to separate an object from the background in the image using python open-cv, which exists as cv2 (computer vision) library. You can use threshold() method of cv2 library to separate […]

Leave a Reply

Your email address will not be published.

Subscribe to our newletter

Get quality tutorials to your inbox. Subscribe now.