projects
/
experiments
/
opencv_trail_effect.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
opencv_trail_effect.cpp: set window size and title
[experiments/opencv_trail_effect.git]
/
opencv_trail_effect.cpp
diff --git
a/opencv_trail_effect.cpp
b/opencv_trail_effect.cpp
index
bc5b187
..
98e3aed
100644
(file)
--- 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 {
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);
inputVideo.open(0);
+#endif
}
if (!inputVideo.isOpened()) {
}
if (!inputVideo.isOpened()) {
@@
-190,6
+197,8
@@
int main(int argc, char *argv[])
}
cv::namedWindow("Frame", cv::WINDOW_NORMAL);
}
cv::namedWindow("Frame", cv::WINDOW_NORMAL);
+ cv::resizeWindow("Frame", frame_size);
+ cv::setWindowTitle("Frame", "OpenCV Trail Effect");
for (;;) {
inputVideo >> input_frame;
for (;;) {
inputVideo >> input_frame;