From ce76e65e5d7c4ad69e7b588380e66e0ec8055ca7 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 3 Jul 2014 12:59:09 -0400 Subject: [PATCH] Updated config --- config/alprd.conf | 11 +++-------- src/daemon.cpp | 16 +++++++++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/config/alprd.conf b/config/alprd.conf index 972b525..bdcadf4 100644 --- a/config/alprd.conf +++ b/config/alprd.conf @@ -4,18 +4,13 @@ ; Declare each stream on a separate line ; each unique stream should be defined as stream = [url] -;stream = http://192.168.0.152/axis-cgi/mjpg/video.cgi?resolution=1280x720&fps=2 -stream = http://192.168.1.3:8089/videofeed -stream = http://192.168.1.3:8089/videofeed -stream = http://192.168.1.3:8089/videofeed - ;stream = http://www.google.com/video.stream ;stream = http://stream2.com/stream -site_id = watchtower-hq +site_id = site-name -;image_folder = /var/www/html/plates/ -image_folder = /tmp/ +store_plates = 0 +store_plates_location = /var/www/html/plates/ ; upload address is the destination to POST to upload_address = http://localhost:9000/alpr/push/ diff --git a/src/daemon.cpp b/src/daemon.cpp index 1f4e94b..e921228 100644 --- a/src/daemon.cpp +++ b/src/daemon.cpp @@ -43,6 +43,7 @@ struct CaptureThreadData std::string config_file; std::string country_code; + bool output_images; std::string output_image_folder; }; @@ -157,7 +158,8 @@ int main( int argc, const char** argv ) return 1; } - std::string imageFolder = ini.GetValue("daemon", "image_folder", "/tmp/"); + bool storePlates = ini.GetBoolValue("daemon", "store_plates", false); + std::string imageFolder = ini.GetValue("daemon", "store_plates_location", "/tmp/"); std::string upload_url = ini.GetValue("daemon", "upload_address", ""); std::string site_id = ini.GetValue("daemon", "site_id", ""); @@ -175,6 +177,7 @@ int main( int argc, const char** argv ) tdata->stream_url = stream_urls[i]; tdata->camera_id = i + 1; tdata->config_file = configFile; + tdata->output_images = storePlates; tdata->output_image_folder = imageFolder; tdata->country_code = country; tdata->site_id = site_id; @@ -250,10 +253,13 @@ void streamRecognitionThread(void* arg) std::string uuid = newUUID(); // Save the image to disk (using the UUID) - std::stringstream ss; - ss << tdata->output_image_folder << "/" << uuid << ".jpg"; - - cv::imwrite(ss.str(), latestFrame); + if (tdata->output_images) + { + std::stringstream ss; + ss << tdata->output_image_folder << "/" << uuid << ".jpg"; + + cv::imwrite(ss.str(), latestFrame); + } // Update the JSON content to include UUID and camera ID