如何在Windows 7 x64上的python 3.4中使用OpenCV? [英] How to use OpenCV in python 3.4 on windows 7 x64?

查看:105
本文介绍了如何在Windows 7 x64上的python 3.4中使用OpenCV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有windows 7 x64python 3.4.我尝试使用cv2模块:

I have windows 7 x64 and python 3.4. I try to use cv2 module:

import numpy as np
import cv2

img = cv2.imread('messi5.jpg',0)

据我所知,无法使用opencv 2使用python 3.4.因此,我下载了 opencv 3 beta .但是我不明白如何为我的目的使用这些东西.文件夹~\opencv\build\python\包含python 2.7 folder,但没有python 3.4 folder.

As I know, there is no way to use opencv 2 with python 3.4. Therefore, I downloaded opencv 3 beta. But I don't understand how to use this stuff for my purpose. Folder ~\opencv\build\python\ contains python 2.7 folder, but there is not python 3.4 folder.

如何解决我的任务?

更新(06.06.2015).

OpenCV 3已发布.您可以直接从官方网站下载.

OpenCV 3 has been released. You can directly download it from official site.

推荐答案

您需要使用cmake从源代码构建它.按照标准安装过程的说明链接,您会发现OPENCVDIR /build/install/python/x64(or86)/3.4/cv.pyd.将此文件和所有.dll文件复制到python site-packges目录中,我能够导入cv2"

you need to build it from source using cmake. Follow the instructions of standard install procedure link, you will find OPENCVDIR/build/install/python/x64(or86)/3.4/cv.pyd. Copy this file and all the .dll files to the python site-packges dir, I was able to "import cv2"

这篇关于如何在Windows 7 x64上的python 3.4中使用OpenCV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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