Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I sorta got it working by adding a cv2.waitKey() after my read() and after the imshow() commands. The strange thing now is that it is not consistent. When I play with timings sometimes it does and doesn't work...

This Works: for i in range (0,len(cams)): read, frame = cams[i].read() cv2.waitKey(500) cv2.imshow("Cameras",frame) cv2.waitKey(500)

But This Does NOT work for i in range (0,len(cams)): read, frame = cams[i].read() cv2.waitKey(5000) cv2.imshow("Cameras",frame) cv2.waitKey(500)

This works for i in range (0,len(cams)): read, frame = cams[i].read() cv2.waitKey(1) cv2.imshow("Cameras",frame) cv2.waitKey(1)

But This Does NOT work for i in range (0,len(cams)): read, frame = cams[i].read() cv2.waitKey(1) cv2.imshow("Cameras",frame) k = cv2.waitKey(4) if k == ord('q'): #CODE TO CLOSE MY WINDOWS HERE

By "not working" I mean (this test anyway) that the program runs with no errors, but it does not open a window and display anything. I've tried throwing in some Print statements for debugging and depending on where I place them, it may or may not work. I can't seem to find any consistency so I can't really figure out "what works (and why)" and "what doesn't."

Any thoughts?

Which brings me to another question about waitKey() that I will ask separately...

Thanks!

J