projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ae1946
)
dnn: add a check for webcam properties in ssd_mobilenet sample
author
berak
<px1704@web.de>
Wed, 6 Dec 2017 13:16:37 +0000
(14:16 +0100)
committer
berak
<px1704@web.de>
Wed, 6 Dec 2017 13:55:37 +0000
(14:55 +0100)
samples/dnn/ssd_mobilenet_object_detection.cpp
patch
|
blob
|
history
diff --git
a/samples/dnn/ssd_mobilenet_object_detection.cpp
b/samples/dnn/ssd_mobilenet_object_detection.cpp
index
db7780d
..
d7b2cbf
100644
(file)
--- a/
samples/dnn/ssd_mobilenet_object_detection.cpp
+++ b/
samples/dnn/ssd_mobilenet_object_detection.cpp
@@
-115,10
+115,12
@@
int main(int argc, char** argv)
(inVideoSize.height - cropSize.height) / 2),
cropSize);
+ double fps = cap.get(CV_CAP_PROP_FPS);
+ int fourcc = static_cast<int>(cap.get(CV_CAP_PROP_FOURCC));
VideoWriter outputVideo;
outputVideo.open(parser.get<String>("out") ,
-
static_cast<int>(cap.get(CV_CAP_PROP_FOURCC
)),
-
cap.get(CV_CAP_PROP_FPS
), cropSize, true);
+
(fourcc != 0 ? fourcc : VideoWriter::fourcc('M','J','P','G'
)),
+
(fps != 0 ? fps : 10.0
), cropSize, true);
for(;;)
{