what does waitKey (30) mean in OpenCV? [duplicate]

The function waitKey() waits for a key event for a “delay” (here, 30 milliseconds). As explained in the OpenCV documentation, HighGui (imshow() is a function of HighGui) need a call of waitKey regularly, in order to process its event loop.

Ie, if you don’t call waitKey, HighGui cannot process windows events like redraw, resizing, input event, etc. So just call it, even with a 1ms delay 🙂

Leave a Comment