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.
解决方案
I've effectively packaged, deployed, and shipped a Python app using OpenCV with cxFreeze.
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):
cxfreeze App.py --target-dir App --base-name Win32GUI --include-modules PySide.QtNetwork
Copy over the opencv\build\x86\vc9\bin files to the App directory.
That's it.
博主分享了如何使用cxFreeze成功打包包含OpenCV的Python应用程序。cxFreeze能够自动识别OpenCV的Python扩展,但需要手动将OpenCV的DLL文件复制到目标目录。此外,该过程在处理QT库时遇到一些问题,但整体打包效果令人满意。

被折叠的 条评论
为什么被折叠?



