Crytrus
Crytrus

Reputation: 821

Display new window in second monitor, opencv

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!

Upvotes: 8

Views: 10636

Answers (1)

UVuuMe
UVuuMe

Reputation: 148

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

Upvotes: 9

Related Questions