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

查看:78
本文介绍了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 2.x安装了适用于Python 3.x的OpenCV,我将非常感谢这里的任何人可以共享他/她的方法.或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和Python3.打开CMake,它将询问源代码在哪里.如果您下载了可执行文件,它将位于您在sources文件夹中提取可执行文件的位置.如果您下载的是最新版本,则无论您在何处下载最新版本.选择文件夹,然后在CMake中,单击configure,它将询问您要使用哪个编译器.之后,您将看到可以在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天全站免登陆