我已经尝试了很多天在我的 Raspberry Pi 4 上使用 Raspbian Buster 安装 OpenCV,但我无法完成。安装在大多数情况下都有效,但在导入或使用 cv2.imshow() 等 cv2 方法时,会出现错误(见下文)。
有人让 OpenCV 在 Raspberry Pi 4 上工作,或者知道如何让它工作?预先感谢您的帮助 :-)!
用pip安装OpenCV后报错:
pip install opencv-python
pip install opencv-contrib-python
python
>>> import cv2
ImportError: libImath-2_2.so.12: cannot open shared object file: no such file or directory
Run Code Online (Sandbox Code Playgroud)
我无法安装这个库“libImath-2_2.so.12”。错误仍然存在。
使用 conda 安装 OpenCV 后出错:
conda install -c conda-forge opencv
conda install -c conda-forge opencv=4.1.0
conda install -c menpo opencv
python
>>> import cv2
>>> img = cv2.imread("image.png", 0)
>>> cv2.imshow("Frame", img)
OpenCV Error: Unspecified …Run Code Online (Sandbox Code Playgroud)