Scott
Scott

Reputation: 5820

Install OpenCV from source or via Pip?

I've seen 2 ways of installing OpenCV (there might be more ways which I don't know):

  1. Installing from the source
  2. Installing with pip: pip install opencv-python

My question is, why we need to install OpenCV from the source while we can simply install it using pip? Since people are using both of them, both must be useful. If so, there are any conditions for selecting one of them?

Upvotes: 0

Views: 1829

Answers (2)

Yousef
Yousef

Reputation: 403

OpenCV is always under development, and the thing is some parts of the library is not going to published, due to compatibility and copyright issues, but if you use the source then you can have all the capabilities that you need. SURF & SIFT are examples of this problem.

Upvotes: 1

Arun Soorya
Arun Soorya

Reputation: 484

I will list out the differences between both

1.

Installation using pip

Installation is done at the default location where all the python packages resides.

Installation from Source

Installation location is provided by the developer.

2.

Installation using pip

In terms of performance, the packages installed might run slower because of the hidden conflicts between features.

Installation from Source

The developer can select the optimization flags during the compilation of packages which are responsible for the fast performance of library.

3.

Installation using pip

The developers can neither add nor remove features provided in the installation done by pip.

Installation from Source

The developer has all the rights to add or remove the features during the installation of library.

4.

Installation using pip

The package manager will do the work on behalf of developer. Package Manager is also responsible for taking care of library updation.

Installation from Source

The developers are responsible for feature selection and updation of library. They must be aware of new package updates, latest security patches etc, to keep themselves updated about the library.

Hope this helps you!

Upvotes: 3

Related Questions