39

I was looking at the Python Package Index (PyPi) and noticed 2 very similar packages: opencv-contrib-python and opencv-python and wondering what the difference was. I looked at them and they had the exact same description and version numbers.

1

3 Answers 3

53

As per PyPi documentation:

There are four different packages (see options 1, 2, 3 and 4 below):

Packages for standard desktop environments:

Option 1 - Main modules package: pip install opencv-python

Option 2 - Full package (contains both main modules and contrib/extra modules): pip install opencv-contrib-python (check contrib/extra modules listing from OpenCV documentation)

Packages for server (headless) environments:

Option 3 - Headless main modules package: pip install opencv-python-headless

Option 4 - Headless full package (contains both main modules and contrib/extra modules): pip install opencv-contrib-python-headless

Do not install multiple different packages in the same environment

2
  • 4
    How does the headless package differ from the non-headless package? Commented Apr 2, 2023 at 14:04
  • 2
    diff: GUI support or not. on servers, pick a headless variant. you can't present any GUI anyway. Commented Jul 19, 2023 at 17:03
0

Opencv has two compilations for each version, the "regular" one that is functional and well tested and the compilation with the extra components (contribs package) in their github's page they put:

This repository is intended for the development of so-called "extra" modules, contributed functionality. New modules quite often do not have stable API, and they are not well-tested. Thus, they shouldn't be released as a part of the official OpenCV distribution, since the library maintains binary compatibility, and tries to provide decent performance and stability.

Also in contribs package there are several non-free computer vision algorithms (for features) such as SURF, BRIEF, Censure, Freak, LUCID, Daisy, BEBLID, TEBLID.

0

opencv-python provides the core functionality of OpenCV, including the essential image and video processing capabilities. It contains the main modules necessary for image and video I/O, image manipulation, object detection, feature extraction, and basic computer vision tasks. This package is suitable for most general computer vision tasks and is typically used as the base package for basic image processing and analysis.

opencv-contrib-python = opencv-python + extra

There are several additional functionalities that are not available in the standard opencv-python package, like the SIFT algorithm. So, if you need to heavily work on images and computer vision and have no hardware restrictions, definitely install opencv-contrib-python.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.