X-Git-Url: https://git.ao2.it/experiments/opencv_trail_effect.git/blobdiff_plain/21adbf9205a5c28a036ddd2373d85a9662e9b7fc..3128c1a723398a114335437d899dd459b1c5b97c:/opencv_trail_effect.cpp?ds=sidebyside diff --git a/opencv_trail_effect.cpp b/opencv_trail_effect.cpp index bc5b187..98e3aed 100644 --- a/opencv_trail_effect.cpp +++ b/opencv_trail_effect.cpp @@ -131,7 +131,14 @@ int main(int argc, char *argv[]) if (!input_file.empty()) { inputVideo.open(input_file); } else { +#ifdef __linux__ + // XXX Hardcode the V4L2 backend on linux for now because the + // GStreamer one lacks some functionality, see: + // https://github.com/opencv/opencv/issues/18562 + inputVideo.open(0, cv::CAP_V4L2); +#else inputVideo.open(0); +#endif } if (!inputVideo.isOpened()) { @@ -190,6 +197,8 @@ int main(int argc, char *argv[]) } cv::namedWindow("Frame", cv::WINDOW_NORMAL); + cv::resizeWindow("Frame", frame_size); + cv::setWindowTitle("Frame", "OpenCV Trail Effect"); for (;;) { inputVideo >> input_frame;