I use namedWindow with openCV and get an error: (Image1): Gtk-WARNING **: cannot open display:"
The code is:
Mat image1 = imread("image1.jpg");
cv::namedWindow("image1");
cv::imshow("image1",image1);
waitKey(0);
Someone says he solves it by: "export DISPLAY=:0". But I don't really understand what does this solution mean.Since I am a beginner in opencv and c++. Could someone explain it in detail. e.g. How to add the code? Where to implement?