From: Antonio Ospite Date: Thu, 22 Feb 2018 11:56:50 +0000 (+0100) Subject: opencv_trail_effect.cpp: use cv::waitKeyEx() instead of cv::waitKey() X-Git-Url: https://git.ao2.it/experiments/opencv_trail_effect.git/commitdiff_plain/1fb92e6c58573d8188e8fe2cd49257409d15f527?ds=inline opencv_trail_effect.cpp: use cv::waitKeyEx() instead of cv::waitKey() In some OpenCV 3 version there was a change of behavior of cv::waitKey() in case the delay expired with no key presses, use cv::waitKeyEx() to rely on the old behavior. For details see https://github.com/opencv/opencv/pull/7866#issuecomment-269322846 --- diff --git a/opencv_trail_effect.cpp b/opencv_trail_effect.cpp index 97b4aa7..5a4e928 100644 --- a/opencv_trail_effect.cpp +++ b/opencv_trail_effect.cpp @@ -204,7 +204,7 @@ int main(int argc, char *argv[]) trail->draw(canvas); cv::imshow("Frame", canvas); - if (cv::waitKey(30) >= 0) + if (cv::waitKeyEx(30) >= 0) break; if (outputVideo.isOpened())