问题描述
我希望让OpenCV在适用于Python 3.4的Windows 7 x64上运行.即使OpenCV 3 Alpha页面指出有Python 3支持( http://opencv .org/opencv-3-0-alpha.html ),则预编译的软件包仅包含opencv/build/python/2.7,不包含3(.4).
I wish to get OpenCV working on my Windows 7 x64 for Python 3.4.Even though the OpenCV 3 Alpha page states that there is Python 3 support (http://opencv.org/opencv-3-0-alpha.html), the pre-compiled package only contains opencv/build/python/2.7 and no 3(.4).
因此,按照上的答案进行操作如何在Windows 7 x64上的python 3.4中使用OpenCV?,我正在尝试按照以下教程从源代码构建OpenCV 3.0.0: http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html .
So following the answer on How to use OpenCV in python 3.4 on windows 7 x64?, I'm trying to build OpenCV 3.0.0 from source following the following tutorial: http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html.
但是,由于本教程有些过时,因此按照某些步骤操作会遇到一些问题.
However since this tutorial is a bit outdated, I've some problems following certain steps.
- OpenNI链接已死,因此我安装了KinectSDK-v1.6-Setup.exe( https://www.microsoft.com/zh-cn/download/details.aspx?id=34808 )和OpenNI-Windows-x64-2.2.msi( http://structure.io/openni ).这样够好吗?
- Qt框架链接已死.我有Visual Studio 2013,所以我需要这个吗?或如何在不下载整个Qt开发工具包的情况下获取所需文件( http://www.qt.io/)?
- CMake:我从Github的OpenCV获得了最新版本,但是它没有文件夹"Source"和"Builds",那么在CMake(3.2.2)中如何选择文件夹?抱歉,我是新来的.
- The OpenNI link is dead, so I installed KinectSDK-v1.6-Setup.exe (https://www.microsoft.com/en-us/download/details.aspx?id=34808) and OpenNI-Windows-x64-2.2.msi (http://structure.io/openni). Is this good enough?
- The Qt framework link is dead. I have Visual Studio 2013, so do I need this? or how do I just get the required files without downloading the whole Qt development kit (http://www.qt.io/)?
- CMake: I got the latest version from OpenCV from Github, but it doesn't have the folders "Source" and "Builds", so what do I select as folders in CMake (3.2.2)? Sorry I'm new to this.
非常感谢您提供任何帮助(或指向已编译的Python 3.4 cv2.pyd的链接)
Any help is greatly appreciated (or a link to a compiled Python 3.4 cv2.pyd)
opencv.org: http: //answers.opencv.org/question/60190/building-opencv-300-beta-windows-python-34/
opencv.org: http://answers.opencv.org/question/60190/building-opencv-300-beta-windows-python-34/
推荐答案
我正好分享您的挫败感.荒谬的一个主要程序包,要求它的用户跳过这么多圈,从源代码构建它,只是将其用作Python中的import cv2
.我的其他软件包仅安装在pip
!
I share precisely your frustrations. Ridiculous of a major package to demand that its users jump through so many hoops, building it from source, simply to use it as an import cv2
in Python. My other packages I just install in one line from pip
!
关于OpenCV错误跟踪程序的票证,其中记录了使用已编译的Python 3.4 cv2.pyd的进度OpenCV网站上的 OpenCV 3.0下载中包含的文件.截至2015年6月6日为止,还没有.
The ticket on the OpenCV bug tracker documenting progress on having a compiled Python 3.4 cv2.pyd file included in the OpenCV 3.0 download on the OpenCV site. As of 6 June 2015 it's not there yet.
但是,令人欣喜的是,Christoph Gohlke维护了许多Python软件包的Windows二进制文件,包括带有Python 3.x绑定的OpenCV 3.0!看到这里:
However, the great news is, Christoph Gohlke maintains Windows binaries for many Python packages, including OpenCV 3.0 with Python 3.x bindings! See here:
http://www.lfd.uci.edu/~gohlke/pythonlibs /#opencv
要安装,只需下载适合您系统的64位或32位.whl
文件,然后运行pip install [filename]
.然后,指令import cv2
应该可以在您的Python 3.x解释器中使用.
To install, just download the 64-bit or 32-bit .whl
file appropriate for your system, then run pip install [filename]
. Then the instruction import cv2
should work in your Python 3.x interpreter.
这篇关于构建OpenCV 3.0.0-beta Windows Python 3.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!