开发者

Configure position of window for cv::imshow

开发者 https://www.devze.com 2023-02-01 06:12 出处:网络
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-scree开发者_如何学Pythonn, so I have to drag it around bef

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-scree开发者_如何学Pythonn, 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?


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);


Using C++ API it is not possible at the moment.

You can use C API instead; it is cvMoveWindow().

UPDATE: Now it is possible in C++ with cv::moveWindow()

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号