From 2c9824b00f165debffaa8c696175009a70c600fc Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Sun, 12 May 2013 14:37:24 -0400 Subject: [PATCH] Add support for streaming from webcams through OpenCV --- openbr/plugins/stream.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/openbr/plugins/stream.cpp b/openbr/plugins/stream.cpp index 3c723c7..9bebf3c 100644 --- a/openbr/plugins/stream.cpp +++ b/openbr/plugins/stream.cpp @@ -270,7 +270,23 @@ public: next_idx = 0; basis = input; - video.open(input.file.name.toStdString()); + bool is_int = false; + int anInt = input.file.name.toInt(&is_int); + if (is_int) + { + bool rc = video.open(anInt); + + if (!rc) + { + qDebug("open failed!"); + } + if (!video.isOpened()) + { + qDebug("Video not open!"); + } + } + else video.open(input.file.name.toStdString()); + return video.isOpened(); } -- libgit2 0.21.4