Take OpenCV window and make full screen

I am using OpenCV 2.1 on Ubuntu 11.04. On my system CV_WINDOW_FULLSCREEN and CV_WINDOW_AUTOSIZE flags both map to 1 And both flags behave exactly the same. They give you a fixed size window, which would be expected for AUTOSIZE flag but not the FULLSCREEN. I think these two flags are meant for different functions although their simillar appearance is very confusing. The flag CV_WINDOW_NORMAL maps to value 0 which is what you have used. It gives you a resizable window that you could maximize, but it is not a fullscreen window.

Edit: I just found the solution in another stachoverflow post. Here is the solution from that post which worked great on my system:

    cvNamedWindow("Name", CV_WINDOW_NORMAL);
    cvSetWindowProperty("Name", CV_WND_PROP_FULLSCREEN, CV_WINDOW_FULLSCREEN);
    cvShowImage("Name", your_image);

I get a real fullscreen with no title bar etc.


you can use the cv::setWindowProperty function for your purpose, just set it to CV_WINDOW_FULLSCREEN.

Full documentation in the openCV-WIKI


In opencv/4.5.1, this is how it is done:

    namedWindow("Name", WINDOW_NORMAL);
    setWindowProperty ("Name", WND_PROP_FULLSCREEN, WINDOW_FULLSCREEN);

Assuming you have added using namespace cv;