Display new window in second monitor, opencv

十年热恋 提交于 2021-01-27 04:37:54

问题


I have a opencv program in python that takes frames from a webcam and displays the feed. When 'p' is pushed, it grabbes just the face and display this one frame in another window.

I would like to force this new window on to my second monitor while the camera feed is on the other one - the "main" monitor. Now it just displays on top of the feed.

I have been looking and searching but can't find anything else than moveWindow. How can I use this or another function to do this?

Hope someone can help me one this!


回答1:


I found that using named window followed by moveWindow allowed me to push the image to my second monitor. The -900 pushes the window upward.

def im_show(img, name, time):

     cv2.namedWindow(name)
     cv2.moveWindow(name, 900,-900)
     cv2.imshow(name, img)
     cv2.waitKey(time)

return


来源:https://stackoverflow.com/questions/26940559/display-new-window-in-second-monitor-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!