Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

add a

 cv::waitKey(10);

after the imshow(); else nothing will get drawn ever.

add a

 cv::waitKey(10);

after the imshow(); else nothing will get drawn ever.

(imshow() only copies an image pointer, waitKey() holds the internal event loop, which will trigger the drawing/update finally)

add a

 cv::waitKey(10);

after the imshow(); else nothing will get drawn ever.

(imshow() only copies an image pointer, waitKey() holds the internal event loop, which will trigger the drawing/update finally)

also note: if you ever get here:

if (frame.empty()) {

when playing a video file, it means , that you reached the last frame (and you should probably return, or break out of the loop)