opencv_trail_effect.cpp: use cv::waitKeyEx() instead of cv::waitKey()
authorAntonio Ospite <ao2@ao2.it>
Thu, 22 Feb 2018 11:56:50 +0000 (12:56 +0100)
committerAntonio Ospite <ao2@ao2.it>
Thu, 22 Feb 2018 14:41:51 +0000 (15:41 +0100)
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

opencv_trail_effect.cpp

index 97b4aa7..5a4e928 100644 (file)
@@ -204,7 +204,7 @@ int main(int argc, char *argv[])
                trail->draw(canvas);
 
                cv::imshow("Frame", canvas);
                trail->draw(canvas);
 
                cv::imshow("Frame", canvas);
-               if (cv::waitKey(30) >= 0)
+               if (cv::waitKeyEx(30) >= 0)
                        break;
 
                if (outputVideo.isOpened())
                        break;
 
                if (outputVideo.isOpened())