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
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())