X-Git-Url: https://git.ao2.it/experiments/opencv_trail_effect.git/blobdiff_plain/1fb92e6c58573d8188e8fe2cd49257409d15f527..b050cda477dda110886e4b65ae67f217bca0681a:/opencv_trail_effect.cpp?ds=inline diff --git a/opencv_trail_effect.cpp b/opencv_trail_effect.cpp index 5a4e928..6c0d09c 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); @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) goto out_delete_trail; } - cv::namedWindow("Frame", CV_WINDOW_AUTOSIZE); + cv::namedWindow("Frame", CV_WINDOW_NORMAL); for (;;) { inputVideo >> input_frame;