From d95730d40e8fa80d3cc6081ebb59136de0893efb Mon Sep 17 00:00:00 2001 From: psaintjust Date: Mon, 29 Jun 2015 11:36:02 -0400 Subject: [PATCH] Added ability to use daemon with local webcam --- config/alprd.conf | 7 +------ src/video/videobuffer.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/config/alprd.conf b/config/alprd.conf index bc1259b..493b992 100644 --- a/config/alprd.conf +++ b/config/alprd.conf @@ -1,5 +1,3 @@ - - [daemon] ; country determines the training dataset used for recognizing plates. Valid values are: us, eu @@ -13,14 +11,11 @@ site_id = your-unique-sitename stream = http://127.0.0.1/example_video_stream.mjpeg ;stream = http://127.0.0.1/example_second_stream.mjpeg - +;stream = webcam ; topn is the number of possible plate character variations to report topn = 10 - - - ; Determines whether images that contain plates should be stored to disk store_plates = 0 store_plates_location = /var/lib/openalpr/plateimages/ diff --git a/src/video/videobuffer.cpp b/src/video/videobuffer.cpp index 3f9d76a..fc14dd3 100644 --- a/src/video/videobuffer.cpp +++ b/src/video/videobuffer.cpp @@ -107,7 +107,15 @@ void imageCollectionThread(void* arg) { cv::VideoCapture cap=cv::VideoCapture(); dispatcher->log_info("Video stream connecting..."); - cap.open(dispatcher->mjpeg_url); + + if (dispatcher->mjpeg_url == "webcam") + { + cap.open(0); + } + else + { + cap.open(dispatcher->mjpeg_url); + } if (cap.isOpened()) { @@ -198,4 +206,4 @@ void getALPRImages(cv::VideoCapture cap, VideoDispatcher* dispatcher) // Delay 100ms sleep_ms(100); } -} \ No newline at end of file +}