在第二个监视器中显示新窗口,opencv [英] Display new window in second monitor, opencv
问题描述
我在 python 中有一个 opencv 程序,它从网络摄像头获取帧并显示提要.当p"被按下时,它只抓取人脸并在另一个窗口中显示这一帧.
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.
我一直在寻找和搜索,但除了 moveWindow 找不到其他任何东西.我怎样才能使用这个或另一个函数来做到这一点?
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!
推荐答案
我发现使用命名窗口后跟 moveWindow 允许我将图像推送到我的第二台显示器.-900 向上推动窗口.
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
这篇关于在第二个监视器中显示新窗口,opencv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!