How to install OpenCV in Python

OpenCV is an open-source Python library, which used to understand the content of the digital image. The CV is the abbreviation form of computer vision. It extracts the description from the real-time image or digital image, which may be an object, a text description, and so on.

We can perform many tasks using the OpenCV library such as face detection, face recognition, blob detection, edge-detection, image filter, template matching, and etc. To work with the OpenCV, we need to install it in our Python environment.

Installation of OpenCV

Here, we install the OpenCV using the following ways.

  • Using pip command
  • Using Anaconda

Using pip command

Open a command prompt and type the following command.

Or, we can install it without extra module by the following command.


How to install OpenCV in Python

Now, we will verify the proper installation of OpenCV. Import the cv2 module and print its version.

How to install OpenCV in Python

If it has properly installed, then it will show its version.

Using Anaconda

Anaconda is a software package of Python. Anaconda with Jupyter is a the best way to work with the OpenCV. First, we need to install the Anaconda graphics installer from its official site.

How to install OpenCV in Python

Now, choose a suitable bit installer.

How to install OpenCV in Python

Once download is completed. Open the Anaconda prompt and type the following command.


How to install OpenCV in Python

Then, hit the enter button and it will download all rated OpenCV configuration.

How to install OpenCV in Python

Now, we are ready to work with the OpenCV. You can learn complete OpenCV through our OpenCV tutorial (https://www.javatpoint.com/opencv).






Latest Courses