What's the difference with opencv, python-opencv, and libopencv? - python

I'm new to opencv and using ubuntu 14.04, I'm confused of the difference with opencv, python-opencv, and libopencv, as I have libopencv and python-opencv installed in my system, but I there is no cv interface accessible, so I have to install opencv which is much hard than python-opencv and libopencv.

I would like to add to Andika's answer.
OpenCV is computer vision a library written using highly optimized C/C++ code. It makes use of multiprocessing in the background. It has a collection of a large number of algorithms tested and verifiend by the developers. The best thing about this is it's FREE under the BSD license.
libopencv is only a metapackage. These packages do not contain actual software, they simply depend on other packages to be installed. So libopencv is a metapackage which simply references one or more related packages which are loosely grouped together. It is dedicated for installing OpenCV in Ubuntu and Debian OS.
opencv-python is the OpenCV library available as a wrapper with bindings for python. The link also shows how to install OpenCV in Ubuntu OS.

libopencv is the debian/ubuntu package while python-opencv is the python wrapper and can be accessed using cv2 interface like COLDSPEED mentioned

Related

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):
Installing from the source
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?
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!
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.

Which components do what when using Python with OpenCV?

I'm quite puzzled about what to use or install, because there are a plethora of components old and new, and the relationship between them is quite unclear to me.
There is OpenCV, the C++ library that does the heavy lifting.
Then there are various packages that provide Python support, including:
opencv-python - Python packages for OpenCV; also installs OpenCV itself. Available with import cv2.
pyopencv - a very old library.
python-opencv - a Debian package.
libopencv, described in another question here as "only a metapackage", but its purpose remains unclear to me.
Possibly I have missed some...
For a modern Python 3 project, which of these components should be used?
Using import cv
I am trying to use OpenCV with a Django project, that expects to find the library with import cv.
That recommends installing python-opencv. It also mentions pyopencv which seems odd, given how old the latter is.
What package does make a cv module available?
System vs Python packages
It looks like python-opencv is a system-level package that also installs Python modules, whereas opencv-python is a Python package that also installs system-level modules.
Is that correct? In which case, am I right in thinking that one would install both system and Python libraries using one of these but not both?
in opencv3 the old cv or cv2.cv api was removed, to use opencv correctly in python is enough with import cv2.
another package would be opencv-contrib-python

VLFeat installation for Python

I am new to Python and I want to install VLFeat on Ubuntu (13.04).
I am using Eclipse 3.8. For Python, I have installed the PyDev extension on Eclipse.
I have installed Numpy, but I don't know how to install VLFeat. I tried to use their website, but I can't get anything for Python. I have downloaded packages, but I don't know how to install them.
The Menpo Project provides a wrapper around VLFeat: it's called cyvlfeat.
To install cyvlfeat, we strongly suggest you use conda:
conda install -c menlo cyvlfeat
If you don't want to use conda, your
mileage will vary. In particular, you must satisfy the
linking/compilation requirements for the package, which include the
vlfeat dynamic library.
In other words, the nice thing about installing with conda is that it will install (and link) VLFeat dependencies as well.
It may not include all functionalities of VLFeat. Current State as of March 2017:
fisher
fisher
generic
set_simd_enabled, get_simd_enabled, cpu_has_avx, cpu_has_sse3, cpu_has_sse2
get_num_cpus,
get_max_threads, set_num_threads, get_thread_limit
hog
hog
kmeans
kmeans
kmeans_quantize
ikmeans, ikmeans_push
hikmeans, hikmeans_push
sift
dsift
sift
Relevant reading
Dev blog by Simmi Mourya. This includes descriptions and usage examples.
More alternatives:
vlfeat-ctypes: minimal VLFeat interface for python
pyvlfeat fork by jchazalon: A high-level Python wrapper around a subset of the VLFeat library [more recently updated than the original]
Note about the IDE
Installing python packages should be independent of the IDE (Eclipse + PyDev, in the OP case), as long as the interpreter and libraries paths are correctly set up.
Note about conda
It is not required to install the Anaconda distribution in order to use conda. The much lighter Miniconda is enough.
Assuming you are getting VLFeat from the Python Package Index, the instructions are
Download distribution, extract it, get to command prompt and type:
$ python setup.py install

Anyone have experience using the Nessi Python Network Simulator?

I am working on creating a simulation for the selective-reject ARQ protocol for my networking class. I found a great network simulator, written in python called Nessi:
http://jer.iict.ch/logiciels
The one problem is that it seems Nessi relies on an older version of python (2.4) than what I currently have installed on my computer(2.7).
There is almost no documentation and I am trying to figure out where to begin!
I have two questions:
Has anyone tried installing Nessi on Snow Leopard, OSX?
I am thinking of using virtualenv to have a contained version of
python and the necessary modules for Nessi. Is there something else
I should be considering?
It is possible to run it in Snow Leopard.
Use a package management system like fink to install the dependencies required for this package, I think most of the dependencies can be installed using fink like(psyco, numpy, matplotlib,wxpython), you have to experiment with newer version of python to see how it goes, because certain libraries available in fink are for newer version of python.
Fink separates the binary it installs from system binaries, so you can work without fear of damaging your system binaries.

installing opencv for python issues

I'm running OS X Leopard. I followed this site to install it. Trying to run any demo script, I now get "No module named opencv.cv", which is obviously stopping me from doing any programming. I am running python 2.5.1 (yes, I know it's kind of old).
Why would this be, and how can I solve it?
Thanks
You need to compile openCV unfortunately. It's not that hard to do though at least.
A nice route is to use MacPorts: First, be sure to have py26-numpy installed to have support for basic functions such as cv.fromarray :
sudo port install py26-numpy
Then, opencv will compile (with no problem on my side):
sudo port install opencv +python26
Your link tells to install OpenCV with MacPorts, which currently installs version 2.2.0. The API was changed for 2.2, so that might be the reason opencv.cv doesn't exist (also your link is written for the ancient 1.0). OpenCV changelog explains it:
http://opencv.willowgarage.com/wiki/OpenCV%20Change%20Logs
It isn't clear to me how up-to-date the OpenCV documentation is nowadays but I recommend looking at it:
http://opencv.willowgarage.com/documentation/python/index.html
(Python examples there begin with import cv)

Categories