Are there specific times when cv2.waitKey() is required?
So I've been playing around with various ideas for capturing some webcam feeds, and I am finding that I get varied results (some good some bad) by placing cv2.waitKey() functions in various places within my code.
I know that it is typically used to capture keyboard input, but I also read that cv2.waitKey() 'performs various tasks' (I'm paraphrasing as I don't remember the quote). Are there rules for when this function is required and / or when it is recommended? If so, can anyone point me to them?
(For instance) I asked in another question about why a loop of alternating frames from 2 webcams wasn't working... This evening, I got it working by adding a cv2.waitKey(1) after the .read() function and then after the .imshow() function. I tried different timings and different placements with varied (seemingly inconsistent) results.
Thank you very much! J
IMHO when you want to see that image that you are displaying; or I have also met it when playing a video and you want to save the frame, or stop it, or close it, or whatever, based on the specific keys