opencv display image without x server

2019-07-01 13:19发布

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

Using opencv

I am using rasbian on Raspberrypi

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

basic code could be

#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!!

1条回答
Rolldiameter
2楼-- · 2019-07-01 13:40

I used the SDL library

Home page SDL

查看更多
登录 后发表回答