Open In App

How to install OpenCV Contrib Python

OpenCV (Open Source Computer Vision Library) is a powerful open-source computer vision and machine learning software library. It provides various tools and algorithms for image and video processing, object detection, feature extraction, and more. OpenCV Contrib is an extension module that includes additional functionalities and algorithms contributed by the community. In this article, we will see how we can install OpenCV Contrib Python.

What is OpenCV Contrib Library in Python?

OpenCV Contrib is an extension of the OpenCV (Open Source Computer Vision) library in Python. It extends the capabilities of the OpenCV library in Python by offering additional features and modules. These extras aren’t in the main OpenCV library for reasons like being experimental, serving niche needs, or relying on third-party tools. With these added modules, you can do a lot more in computer vision, like detecting features, tweaking images, tracking objects, diving into machine learning, and much more.



Installing OpenCV Contrib Python

Below are the step-by-step procedure by which we can install OpenCV contrib in Python:

Step 1: Install OpenCV

Before installing OpenCV Contrib, you need to install OpenCV itself. You can do this using pip, Python’s package manager, with the following command:



pip install opencv-python

This command will install the main OpenCV package, which includes essential modules for image and video processing.

Output:

Step 2: Install OpenCV Contrib

Alternating, we use pre-built binaries that include OpenCV Contrib modules. These binaries are available for different platforms and Python versions. You can install them using pip:

pip install opencv-contrib-python

This command will install both OpenCV and OpenCV Contrib as pre-built binaries, saving you the hassle of building from source.

Output:

Article Tags :