IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 游戏开发 -> cannot import name ‘_registerMatType‘ from ‘cv2.cv2‘ -> 正文阅读

[游戏开发]cannot import name ‘_registerMatType‘ from ‘cv2.cv2‘

原版opencv执行图像增强出现

(py37cv34) kobosp@R1015u:~/SLAC/TreeLabelMerge$ python3 7YOLOAlbumentation.py 
Traceback (most recent call last):
  File "7YOLOAlbumentation.py", line 2, in <module>
    import cv2
  File "/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/__init__.py", line 9, in <module>
    from .cv2 import _registerMatType
ImportError: cannot import name '_registerMatType' from 'cv2.cv2' (/home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/cv2.cpython-37m-x86_64-linux-gnu.so)

先卸载图像增强

pip uninstall albumentations
Found existing installation: albumentations 1.1.0
Uninstalling albumentations-1.1.0:
  Would remove:
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/albumentations-1.1.0.dist-info/*
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/albumentations/*
Proceed (y/n)? y
  Successfully uninstalled albumentations-1.1.0

再卸载原版OPENCV heartless

!pip uninstall opencv-python-headless
pip uninstall albumentations uninstall opencv-python-headless
WARNING: Skipping albumentations as it is not installed.
WARNING: Skipping uninstall as it is not installed.
Found existing installation: opencv-python-headless 4.5.5.64
Uninstalling opencv-python-headless-4.5.5.64:
  Would remove:
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/*
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless-4.5.5.64.dist-info/*
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libavcodec-65fa80df.so.58.134.100
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libavformat-8ef5c7db.so.58.76.100
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libavutil-9c768859.so.56.70.100
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libbz2-a273e504.so.1.0.6
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libcrypto-09fe7800.so.1.1
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libgfortran-91cc3cb1.so.3.0.0
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libopenblas-r0-f650aae0.3.3.so
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libquadmath-96973f99.so.0.0.0
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libssl-b92f8066.so.1.1
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libswresample-99364a1c.so.3.9.100
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libswscale-e6451464.so.5.9.100
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/opencv_python_headless.libs/libvpx-1016051d.so.7.0.0
  Would not remove (might be manually added):
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libQtCore-ada04e4a.so.4.8.7
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libQtGui-903938cd.so.4.8.7
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libQtTest-1183da5d.so.4.8.7
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libavcodec-4cf96bc1.so.58.65.103
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libavformat-b798543f.so.58.35.101
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libavutil-ac3ec209.so.56.38.100
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libbz2-7225278b.so.1.0.3
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libcrypto-cc2fb98b.so.1.1
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libssl-fdf0b66c.so.1.1
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libswresample-994f1795.so.3.6.100
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libswscale-99a5f1f1.so.5.6.100
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libvpx-3dd7ccd6.so.6.2.0
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/.libs/libz-a147dcb0.so.1.2.3
    /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages/cv2/cv2.cpython-37m-x86_64-linux-gnu.so
Proceed (y/n)? y
  Successfully uninstalled opencv-python-headless-4.5.5.64

安装老版本heartless

pip install albumentations -i https://pypi.mirrors.ustc.edu.cn/simple/
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/
Collecting albumentations
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/75/27/a8b0a738f8423b7ef9d0c9f8e73d5867395dbdae563c1655e9548cf700b9/albumentations-1.1.0-py3-none-any.whl (102 kB)
Requirement already satisfied: PyYAML in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (6.0)
Requirement already satisfied: scikit-image>=0.16.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (0.19.2)
Requirement already satisfied: numpy>=1.11.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (1.21.3)
Requirement already satisfied: opencv-python-headless>=4.1.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (4.1.2.30)
Requirement already satisfied: scipy in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (1.7.3)
Requirement already satisfied: qudida>=0.0.4 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (0.0.4)
Requirement already satisfied: typing-extensions in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from qudida>=0.0.4->albumentations) (4.1.1)
Requirement already satisfied: scikit-learn>=0.19.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from qudida>=0.0.4->albumentations) (1.0.2)
Requirement already satisfied: packaging>=20.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (21.3)
Requirement already satisfied: pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (9.1.0)
Requirement already satisfied: imageio>=2.4.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2.18.0)
Requirement already satisfied: PyWavelets>=1.1.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (1.3.0)
Requirement already satisfied: tifffile>=2019.7.26 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2021.11.2)
Requirement already satisfied: networkx>=2.2 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2.6.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from packaging>=20.0->scikit-image>=0.16.1->albumentations) (3.0.7)
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-learn>=0.19.1->qudida>=0.0.4->albumentations) (3.1.0)
Requirement already satisfied: joblib>=0.11 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-learn>=0.19.1->qudida>=0.0.4->albumentations) (1.1.0)
Installing collected packages: albumentations
Successfully installed albumentations-1.1.0

安装图像zqiang

pip install albumentations -i https://pypi.mirrors.ustc.edu.cn/simple/
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/
Collecting albumentations
  Using cached https://mirrors.bfsu.edu.cn/pypi/web/packages/75/27/a8b0a738f8423b7ef9d0c9f8e73d5867395dbdae563c1655e9548cf700b9/albumentations-1.1.0-py3-none-any.whl (102 kB)
Requirement already satisfied: PyYAML in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (6.0)
Requirement already satisfied: scikit-image>=0.16.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (0.19.2)
Requirement already satisfied: numpy>=1.11.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (1.21.3)
Requirement already satisfied: opencv-python-headless>=4.1.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (4.1.2.30)
Requirement already satisfied: scipy in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (1.7.3)
Requirement already satisfied: qudida>=0.0.4 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from albumentations) (0.0.4)
Requirement already satisfied: typing-extensions in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from qudida>=0.0.4->albumentations) (4.1.1)
Requirement already satisfied: scikit-learn>=0.19.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from qudida>=0.0.4->albumentations) (1.0.2)
Requirement already satisfied: packaging>=20.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (21.3)
Requirement already satisfied: pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (9.1.0)
Requirement already satisfied: imageio>=2.4.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2.18.0)
Requirement already satisfied: PyWavelets>=1.1.1 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (1.3.0)
Requirement already satisfied: tifffile>=2019.7.26 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2021.11.2)
Requirement already satisfied: networkx>=2.2 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-image>=0.16.1->albumentations) (2.6.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from packaging>=20.0->scikit-image>=0.16.1->albumentations) (3.0.7)
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-learn>=0.19.1->qudida>=0.0.4->albumentations) (3.1.0)
Requirement already satisfied: joblib>=0.11 in /home/kobosp/.conda/envs/py37cv34/lib/python3.7/site-packages (from scikit-learn>=0.19.1->qudida>=0.0.4->albumentations) (1.1.0)
Installing collected packages: albumentations
Successfully installed albumentations-1.1.0

opencv版本不匹配导致没法显示

Traceback (most recent call last):
  File "7YOLOAlbumentation.py", line 24, in <module>
    cv2.waitKey(0)
cv2.error: OpenCV(4.1.2) /io/opencv/modules/highgui/src/window.cpp:717: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey'


差不多能用就新

  游戏开发 最新文章
6、英飞凌-AURIX-TC3XX: PWM实验之使用 GT
泛型自动装箱
CubeMax添加Rtthread操作系统 组件STM32F10
python多线程编程:如何优雅地关闭线程
数据类型隐式转换导致的阻塞
WebAPi实现多文件上传,并附带参数
from origin ‘null‘ has been blocked by
UE4 蓝图调用C++函数(附带项目工程)
Unity学习笔记(一)结构体的简单理解与应用
【Memory As a Programming Concept in C a
上一篇文章      下一篇文章      查看所有文章
加:2022-04-29 12:26:53  更:2022-04-29 12:27:25 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/23 18:25:10-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码