Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 203
Crytrus Avatar asked Nov 14 '14 23:11

Crytrus


1 Answers

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
like image 175
UVuuMe Avatar answered Nov 13 '22 01:11

UVuuMe