So I'm contemplating what language to use in the development of an app that uses OpenCV. As a part of my decision, I'm interested in knowing how easy/difficult it is to include the opencv library in the final app. I'd really like to write this in python because the opencv bindings are great, python's easy, etc.
But I haven't been able to find a clear answer on stuff like "does py2app automatically bundle opencv when it sees the import cv line" (I think not) and if not, then is there a known way to do this?
In general, I would like to know the best way to distribute a python desktop app with opencv.
OpenCV is a huge open-source library for computer vision, machine learning, and image processing. OpenCV supports a wide variety of programming languages like Python, C++, Java, etc. It can process images and videos to identify objects, faces, or even the handwriting of a human.
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.
cv2 (old interface in old OpenCV versions was named as cv ) is the name that OpenCV developers chose when they created the binding generators. This is kept as the import name to be consistent with different kind of tutorials around the internet.
I've effectively packaged, deployed, and shipped a Python app using OpenCV with cxFreeze.
http://cx-freeze.sourceforge.net/
Yes, cxFreeze auto picked up the python extensions to OpenCV. I had to manually copy the OpenCV DLLs (Windows), but that was a minor issue that can be solved by a post-processing step in cxFreeze. It does pick up other DLL's, so I'm not sure what the issue was.
In fact, it worked so well I was surprised. The ONLY thing it didn't pick up properly was a QT library. Basically here were my steps (I'm using QT so ignore that part if you aren't):
That's it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With