Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure position of window for cv::imshow

Tags:

Is there a way to change the position of the window that pops up when cv::imshow is called?

For me, the window seems to appear partially off-screen, so I have to drag it around before I can see entire image. It's very annoying to have to do this every single time.

I had a look at the reference manual -- it seems you have control over what goes into the title of the window, but I can't see anything relating to window position.

Oh, and the behavior is the same if I use the old C interface (cvShowImage).

Any ideas?

like image 587
mpenkov Avatar asked Dec 24 '10 14:12

mpenkov


People also ask

How do I close the cv2 Imshow window?

Then if you hit q on your keyboard while imshow window is active it will close.

What is Imshow in OpenCV?

OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2. imshow() method is used to display an image in a window. The window automatically fits to the image size. Syntax: cv2.imshow(window_name, image)

What does cv2 Startwindowthread do?

Do you want to display images and videos using a simplified interface through an OpenCV code? Then, you must check out the OpenCV startWindowsThread() function, which lets you use the high GUI windows, i.e., a simplified interface for displaying images and videos from OpenCV code.


1 Answers

As of OpenCV 2.1 this is possible also in C++ API using the moveWindow function:

cv::moveWindow(std::string winName, int x, int y) 

For example:

cv::namedWindow("WindowName"); cv::moveWindow("WindowName", 10, 50); 
like image 163
Odin Avatar answered Dec 06 '22 21:12

Odin