opencv显示图像没有x服务器 [英] opencv display image without x server

查看:196
本文介绍了opencv显示图像没有x服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在启动时在Linux中显示图像而不启动x服务器

I need to display an image in Linux from startup without starting an x server

使用opencv

我在Raspberrypi上使用rasbian

I am using rasbian on Raspberrypi

错误是无法启动GTK代码(来自cli)
Gtk-WARNING **:无法打开显示:

The error is cannot start GTK code (from cli) Gtk-WARNING **: cannot open display:

基本代码可以

#include <cv.h>
#include <cvaux.h>
#include <highgui.h>
using namespace cv;
int main(int argc, char* argv[ ]){
 Mat image = imread(argv[1]);
 namedWindow("Sample Window");
 imshow("Sample Window",image);
 waitKey(0);
 return 0;
}

欢迎任何其他问题或答案!!

Any further questions or answers welcome!!

推荐答案

我使用了SDL库

主页SDL

这篇关于opencv显示图像没有x服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆