使用 mac 端口安装 opencv 时启用 python 支持

发布于 2024-09-08 23:14:41 字数 232 浏览 0 评论 0原文

我通过以下命令使用 mac ports 在我的 mac 上安装了 opencv

sudo port install opencv

花了大约 2 个小时,安装正确。但问题是 python 绑定未启用。

所以请让我知道如何使用 ports 在 mac 中安装 opencv 并启用 python 绑定。谢谢

PS:我尝试从源代码手动编译 opencv,但遇到很多错误,但我无法做到这一点。

I installed opencv in my mac using mac ports by the following command

sudo port install opencv

It took around 2 hours and it installed properly. But the problem is that the python bindings are not enabled.

So please let me know how to install opencv in mac using ports and also enable the python bindings. Thanks

PS: I tried to manually compile opencv from source but I am getting lot of errors and I am not able to do it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梓梦 2024-09-15 23:14:41

请务必安装py26-numpy以支持基本功能,例如cv.fromarray

sudo port install py26-numpy

opencv将在没有numpy的情况下静默编译(它不是严格是一个依赖项)。

sudo port install -v opencv +python26

在那里你可以检查与 numpy 的绑定是否有效。

be sure to have py26-numpy installed to have support for basic functions such as cv.fromarray :

sudo port install py26-numpy

opencv will compile silently without numpy (it's not strictly a dependency).

sudo port install -v opencv +python26

there you can check that the binding to numpy is effective.

世界等同你 2024-09-15 23:14:41

可以在macos上使用cmake编译opencv(我实际上正在这样做),但是videoWriter有问题......

看看那里http://www.tsd.net.au/blog/opencv-python-bindings-macports

应该会有所帮助。

It's possible to compile opencv using cmake on macos (I'm actually doing this) but there is a problem with the videoWriter ...

Have a look there http://www.tsd.net.au/blog/opencv-python-bindings-macports

should be helpful.

半仙 2024-09-15 23:14:41

我仍然无法正确编译 opencv。最后,我从 http 找到了一些预编译的 dmg 文件://vislab.cs.vt.edu/~vislab/wiki/index.php?title=Vision 运行得相当不错。

I am still not able to compile opencv properly. At last, I found some pre-compiled dmg files from http://vislab.cs.vt.edu/~vislab/wiki/index.php?title=Vision which is working pretty decently.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文