Windows 下 Python 3.x 的 OpenCV [英] OpenCV for Python 3.x under Windows

查看:23
本文介绍了Windows 下 Python 3.x 的 OpenCV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 Internet 上搜索了一段时间,但我找不到有关如何在 Windows 下为 Python 3.x 安装 OpenCV 的详细说明.

I've been searching around the Internet for a while but I have not been able to find detailed instructions on how to install OpenCV for Python 3.x under Windows.

如果这里有人可以分享他/她的方法,如果他/她已经成功安装了 OpenCV for Python 3.x,无论是从预构建的二进制文件还是从源代码,无论是 OpenCV 2.x 版本,我都将不胜感激或 OpenCV 3.x.

I would really appreciate if anyone here can share his/her method if he/she had successfully installed OpenCV for Python 3.x, either from a pre-built binary or from the source code, for either version OpenCV 2.x or OpenCV 3.x.

推荐答案

OpenCV 3 添加了 python 3+ 支持.它仍处于 alpha 阶段,目前它和 python 有很多已知的错误.OpenCV 3 最终版本将于年底发布.

OpenCV 3 added python 3+ support. It is still in alpha and there are a lot of known bugs with it and python at the moment. The final version of OpenCV 3 will be released by the end of the year.

如果您从网站下载 OpenCV 3 alpha 可执行文件,您可以构建对 python 3 的支持.或者,您可以从他们的 github 获取最新代码.您还必须安装 CMake 和 Python 3.打开 CMake,它会询问源代码在哪里.如果您下载了可执行文件,它将位于您在源文件夹中提取可执行文件的位置.如果您下载了最新版本,那么它就在您下载的任何位置.选择文件夹并在 CMake 中点击配置,它会询问您要使用哪个编译器.之后,您可以看到可以在 OpenCV 中构建的所有内容.从 OpenCV 3 开始,有一个适用于 Python3 的选项.检查那个和你可能想要的任何其他东西,然后点击生成.这将在您选择的编译器中创建一个您可以构建的项目,并将构建您需要的所有库.

If you download the OpenCV 3 alpha executable from the website, you can build the support for python 3. Alternatively, you can get the latest code from their github. You will also have to install CMake and Python 3. Open up CMake and it will ask where the source code is. If you downloaded the executable, it will be located where ever you extracted the executable at in the sources folder. If you downloaded the latest build, it is wherever you downloaded that. Select the folder and in CMake, hit configure and it will ask you which compiler you want to use. After that, you can see everything you can build in OpenCV. As of OpenCV 3, there is an option for Python3. Check that and anything else you might want, and hit generate. That will make a project within your compiler of choice that you can build, and that will build all of the library's you need.

虽然本指南适用于 2.4.9,但适用于 3.0.您只会在 3 中看到不同的选项.http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html

While this guide is made for 2.4.9, it works for 3.0. You will just see different options within 3. http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html

这篇关于Windows 下 Python 3.x 的 OpenCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆