From ced198e9390195875d743d77eadece99c7fd5b38 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Mon, 19 Mar 2018 23:17:26 +0000
Subject: [PATCH] Fixed gpu_id for DLL/SO
---
src/demo.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/demo.c b/src/demo.c
index 9e18fd0..f1798c7 100644
--- a/src/demo.c
+++ b/src/demo.c
@@ -143,6 +143,7 @@
printf("video file: %s\n", filename);
cap = cvCaptureFromFile(filename);
}else{
+ printf("Webcam index: %d\n", cam_index);
cap = cvCaptureFromCAM(cam_index);
}
@@ -233,7 +234,7 @@
}
// if you run it with param -http_port 8090 then open URL in your web-browser: http://localhost:8090
- if (http_stream_port > 0) {
+ if (http_stream_port > 0 && show_img) {
//int port = 8090;
int port = http_stream_port;
int timeout = 200;
@@ -242,10 +243,11 @@
}
// save video file
- if (output_video_writer) {
+ if (output_video_writer && show_img) {
cvWriteFrame(output_video_writer, show_img);
printf("\n cvWriteFrame \n");
}
+
cvReleaseImage(&show_img);
pthread_join(fetch_thread, 0);
@@ -293,7 +295,7 @@
}
}
#else
-void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const char *filename, char **names, int classes, int frame_skip, char *prefix, char *out_filename, int http_stream_port)
+void demo(char *cfgfile, char *weightfile, float thresh, int cam_index, const char *filename, char **names, int classes, int frame_skip, char *prefix, char *out_filename, int http_stream_port, int dont_show)
{
fprintf(stderr, "Demo needs OpenCV for webcam images.\n");
}
--
Gitblit v1.10.0