【已解决】python下opencv遇到问题:cv2.error: OpenCV(3.4.2) /tmp/build/80754af9/opencv-suite_1535558553474/work/

  • Post author:
  • Post category:python




问题描述

Traceback (most recent call last):
  File "test.py", line 229, in <module>
    object_is.test(args)
  File "test.py", line 220, in test
    save_path=save_path)
  File "test.py", line 188, in imshow_instance_segmentation
    cv2.imshow('out_img', np.uint8(out_img))
cv2.error: OpenCV(3.4.2) /tmp/build/80754af9/opencv-suite_1535558553474/work/modules/highgui/src/window.cpp:632: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'



解决方法

用pip重新安装opencv

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ opencv-contrib-python

安装成功



版权声明:本文为weixin_41797404原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。