Ask Your Question

Revision history [back]

I have the same problem, happens when I try to create 2 separate windows with cv2.namedWindow("...").

Here is the code:

import cv2

cv2.namedWindow("window1") cv2.namedWindow("window2")

vc = cv2.VideoCapture(0)

cv2.moveWindow("window1", 0, 0) cv2.moveWindow("window2", 641, 0)

if vc.isOpened(): # try to get the first frame rval, frame = vc.read() else: rval = False

while rval: key = cv2.waitKey(20) cv2.imshow("window1", frame) cv2.imshow("window2", frame) rval, frame = vc.read() if key == 27: # Exit on ESC break

cv2.destroyWindow("window1") cv2.destroyWindow("window2")

I have the same problem, happens when I try to create 2 separate windows with cv2.namedWindow("...").

Here is the code:

import cv2

cv2 cv2.namedWindow("window1") cv2.namedWindow("window2")

cv2.namedWindow("window1") cv2.namedWindow("window2")

vc = cv2.VideoCapture(0)

cv2.VideoCapture(0)

cv2.moveWindow("window1", 0, 0) cv2.moveWindow("window2", 641, 0)

0)

if vc.isOpened(): # try to get the first frame rval, frame = vc.read() else: rval = False

False

while rval: key = cv2.waitKey(20) cv2.imshow("window1", frame) cv2.imshow("window2", frame) rval, frame = vc.read() if key == 27: # Exit on ESC break

break cv2.destroyWindow("window1") cv2.destroyWindow("window2")

cv2.destroyWindow("window1") cv2.destroyWindow("window2")