What Is Opencv?

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

What is OpenCV?

OpenCV is a cross-platform library using which we can develop real-time computer vision applications. It
mainly focuses on image processing, video capture and analysis including features like face detection
and object detection.

OpenCV uses machine learning algorithms to search for faces within a picture. Because faces are so
complicated, there isn’t one simple test that will tell you if it found a face or not. Instead, there are
thousands of small patterns and features that must be matched. The algorithms break the task of
identifying the face into thousands of smaller, bite-sized tasks, each of which is easy to solve. These
tasks are also called classifiers.

Computer Vision : Computer Vision can be defined as a discipline that explains how to
reconstruct, interrupt, and understand a 3D scene from its 2D images, in terms of the properties of the
structure present in the scene. It deals with modeling and replicating human vision using computer
software and hardware.

Features of OpenCV Library


Using OpenCV library, you can −

 Read and write images

 Capture and save videos

 Process images (filter, transform)

 Perform feature detection

 Detect specific objects such as faces, eyes, cars, in the videos or images.

 Analyze the video, i.e., estimate the motion in it, subtract the background, and track objects in
it.

OpenCV was originally developed in C++. In addition to it, Python and Java bindings were provided.
OpenCV runs on various Operating Systems such as windows, Linux, OSx, FreeBSD, Net BSD, Open BSD,
etc
Before we install the open cv in our working environment we need to install the python and numpy.

Installing Python in windows:


Step1: Download the python 3 installer
First we need to download the installer from the official website. The download page for Windows at
python.org.

Underneath the heading at the top that says Python Releases for Windows, click on the link for the
Latest Python 3 Release - Python 3.x.x.

Scroll to the bottom and select either Windows x86-64 executable installer for 64-bit or Windows x86
executable installer for 32-bit.

Step2: Run the Installer

Once the download is finished, simply run it by double-clicking on the downloaded file. A dialog should
appear that looks something like this:
Fig: Install successful

After install python successfully now we can check the python in Command Prompt(CMD).

Fig: Checking pyhton

Installing numpy In windows:


NumPy is the fundamental package for scientific computing with Python.

First we need to check whether numpy package is install or not. To check this Open CMD then type

Python

Import numpy

If the result is like this picture that means our pc don’t have numpy package. So we need to install the
package.

Installing via pip:


Open CMD as administrator then
we can install packages via commands such as:
python -m pip install numpy
it will be shown like this picture

Fig: install numpy

Install Opencv 4:
We are going to use pip install method.

Open CMD as administrator.

Use command: pip install opencv-python


Fig: install opencv

Now check the opencv version

Use command:

import cv2

print(cv2.__version__)

Fig: Checking opencv version

You might also like