Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Take OpenCV window and make full screen

I am currently making an OpenCV project in C++ where I look for motion with a kinect and use that to cue a slideshow (sans recognition). Currently, I am displaying the slideshow using OpenCV (as I've only had about a week to whip this up). It looks good and its quick. The only problem is that this is going to be on display for a big production and I can't really afford to have the window showing (I'm talking window decorations like the title bar and such).

I need to get rid of the title bar. I've done a lot of research, and I have found out that you can magically grab the window handle by calling cvGetWindowHandle("SlideShow"), but that is a void function, so I don't really know how I am supposed to get a handle from that to manipulate.

I'm developing this for both windows AND ubuntu, since it will end up on a windows machine, but I can only demo on a laptop running ubuntu.

If anyone can tell me how to take the window and render it fullscreen with a resized image to fill most if not the entire screen in either Windows or Ubuntu, I will be forever grateful.

like image 645
Tubbs Avatar asked Apr 07 '11 06:04

Tubbs


People also ask

What is cv2 namedWindow?

Python OpenCV namedWindow() method is used to create a window with a suitable name and size to display images and videos on the screen. The image by default is displayed in its original size, so we may need to resize the image for it to fit our screen.

What is cv2 moveWindow?

Python OpenCV – moveWindow() FunctionIf we want to show image windows at a specific position moveWindow() function of OpenCV will do it. Syntax: cv2.moveWindow(window_Name,x,y) Parameters: window_name: name of the window which you want to move at particular position. x: Value of x coordinate.


2 Answers

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.

like image 75
Aras Avatar answered Oct 04 '22 09:10

Aras


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

Full documentation in the openCV-WIKI

like image 44
cordellcp3 Avatar answered Oct 04 '22 09:10

cordellcp3