`pip install opencv-python` 是一个完整的 opencv 吗? [英] What is the deal with `pip install opencv-python` is it a full opencv?
问题描述
我认为在我的环境中运行 opencv 的最快方法就是如此简单.
I thought the quickest way to get opencv running in my environment would be as simple as.
sudo pip install opencv-python
它似乎工作正常,我可以导入
It seemed to work properly, I could import
import cv2
img = cv2.imread("a.jpg", 0)
但是没有加载任何其他函数,如cv2.SURF"甚至cv2.imshow".所以 pip install 只是提供一个基本的 opencv?
but any other functions as "cv2.SURF" or even "cv2.imshow" are not loaded. So the pip install is giving just a basic opencv?
推荐答案
此问题已解决 这里Opencv-python 不是官方的.我尝试将其安装在运行 Ubuntu 的 macbook 中,并且和您一样,我可以导入 cv2,但某些功能无法正常工作.
This issue was solved here Opencv-python is not official. I tried to install it in a macbook running Ubuntu and, as you, I could import cv2, but some functions were not working.
来自 opencv-python 网站:
From the opencv-python website:
MacOS 和 Linux 轮子有一些限制:
MacOS and Linux wheels have some limitations:
不支持视频相关功能(未编译FFmpeg) 例如 cv.imshow() 将不起作用(不是用 GTK+ 编译的)2.x 或碳支持)
video related functionality is not supported (not compiled with FFmpeg) for example cv.imshow() will not work (not compiled with GTK+ 2.x or Carbon support)
现在您在尝试安装官方 opencv 时可能会遇到问题.在尝试安装 opencv 之前,您必须完全卸载 opencv-python.
Now you might have problems trying to install the official opencv. You have to completely uninstall opencv-python before you attempt to install opencv.
这篇关于`pip install opencv-python` 是一个完整的 opencv 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!