X-Git-Url: https://git.ao2.it/experiments/opencv_trail_effect.git/blobdiff_plain/d095022ca7b1d9eb46521073b71f2327fb9d5637..5ac5412e847a0abaeaf83c3a0299e68ffaec10f1:/opencv_trail_effect.cpp diff --git a/opencv_trail_effect.cpp b/opencv_trail_effect.cpp index 97b4aa7..5fec5dc 100644 --- a/opencv_trail_effect.cpp +++ b/opencv_trail_effect.cpp @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) if (*segmentation_method == "background") { segmentation = new MOG2Segmentation(inputVideo, background_learn_frames); if (show_background) { - cv::Mat background; + cv::Mat background(frame_size, inputVideo.get(CV_CAP_PROP_FORMAT)); ((MOG2Segmentation *)segmentation)->getBackgroundImage(background); trail->setBackground(background); @@ -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())