Opencv: namedWindow () error "cannot open display"!

I use namedWindow with openCV and get an error message: (Image1): Gtk-WARNING **: cannot open display: "

The code:

Mat image1 = imread("image1.jpg");

cv::namedWindow("image1");
cv::imshow("image1",image1);

waitKey(0);

Someone says that he solves it: "export DISPLAY =: 0". But I really don't understand what this decision means. Since I am new to opencv and C ++. Can someone explain this in detail. e.g. How to add code? Where to implement?

+4
source share
1 answer

It seems that you are missing the context of your X server.

- , , . , , . .

, . , . ( ) ! , OpenCV.

+4

Source: https://habr.com/ru/post/1530262/


All Articles