opencv - qt.qpa.xcb : could not connect to displayerror while using OpenCV on ec2 ubuntu server 20. 0

标签 opencv ubuntu amazon-ec2 xcb

我正在尝试运行此处提到的 Tesseract Ocr 代码
https://www.pyimagesearch.com/2018/09/17/opencv-ocr-and-text-recognition-with-tesseract/
在 ec2 ubuntu 服务器 20.0.
我面临以下错误:

cv2.imshow("Text Detection", output)
错误如下:

qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.8/dist-packages/cv2/qt/plugins" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.


Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc.


Aborted (core dumped)


我知道这行代码会打开一个窗口来显示检测到的输出图像,但是那个窗口没有出现。请帮助解决错误。

最佳答案

您收到此错误是因为没有 UI 可以打开窗口并显示图像。
快速修复将是保存和下载图像。并在本地查看。
另一种方法是设置 XServer 并通过 SSH 启用 X11 转发。

关于opencv - qt.qpa.xcb : could not connect to displayerror while using OpenCV on ec2 ubuntu server 20. 0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64784315/

相关文章:

android - Eclipse LogCat不可读-OpenCV/Android NDK

opencv - 如何在 Raspbian 上编译和构建 openCV

ubuntu - FileNotFoundError : add-apt-repository ppa:certbot/certbot

c# - 如何从另一个目录中找到 C# 中的主文件夹?

ssh - 保持对 Fedora Amazon EC2 实例的访问

java - 准备位图 byte[] 数据以传递给 jni

更改 my.cf 后 MySQL 将无法启动

amazon-web-services - 转移 AWS 促销积分

node.js - 如何在 Amazon EC2 上安装 node.js、couchdb 等?

c++ - SIFT 的空间金字塔匹配 (SPM) 然后输入到 C++ 中的 SVM