关于这个有很多教程和问题。

This似乎回答了你的问题。编辑:复制如下:1) Download OpenCV from http://opencv.org/downloads.html and extract

2)From the extracted folder, copy the file from the extracted directory:

opencv/build/python/2.7/(either x86 or x64, depending on your Anaconda

version)/cv2.pyd to your Anaconda site-packages directory, e.g.,

C:\Anaconda\Lib\site-packages

3)To get ffmpeg within opencv to work, you'll have to add the directory

that ffmpeg is located in to the path (e.g., opencv/sources/3rdparty

/ffmpeg). Then you'll have to find the dll in that folder (e.g.,

opencv_ffmpeg_64.dll) and copy or rename it to a filename that includes

the opencv version you are installing, (e.g., opencv_ffmpeg249_64) for

2.4.9.

{结束复制}

EDIT2:OpenCV不支持Python 3.x,除了opencv3.0版(仍处于测试阶段)。从下载站点下载3.0版本并尝试(感谢this question)。

祝你好运!

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐