From 22b40b2b37d61b401f6d00945d2038c572c4fdb7 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 26 Oct 2014 21:15:10 -0400 Subject: [PATCH] Moved topn value from command line argument to alprd config --- config/alprd.conf | 3 +++ src/daemon.cpp | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/alprd.conf b/config/alprd.conf index 4a7e952..8314f6d 100644 --- a/config/alprd.conf +++ b/config/alprd.conf @@ -4,6 +4,9 @@ country = us +; topn is the number of possible plate character variations to report +topn = 20 + ; Declare each stream on a separate line ; each unique stream should be defined as stream = [url] diff --git a/src/daemon.cpp b/src/daemon.cpp index 33cd527..710166a 100644 --- a/src/daemon.cpp +++ b/src/daemon.cpp @@ -81,14 +81,12 @@ int main( int argc, const char** argv ) bool noDaemon = false; bool clockOn = false; std::string logFile; - int topn; std::string configFile; TCLAP::CmdLine cmd("OpenAlpr Daemon", ' ', Alpr::getVersion()); TCLAP::ValueArg configFileArg("","config","Path to the openalpr.conf file.",false, "" ,"config_file"); - TCLAP::ValueArg topNArg("n","topn","Max number of possible plate numbers to return. Default=25",false, 25 ,"topN"); TCLAP::ValueArg logFileArg("l","log","Log file to write to. Default=" + DEFAULT_LOG_FILE_PATH,false, DEFAULT_LOG_FILE_PATH ,"topN"); TCLAP::SwitchArg daemonOffSwitch("f","foreground","Set this flag for debugging. Disables forking the process as a daemon and runs in the foreground. Default=off", cmd, false); @@ -97,7 +95,6 @@ int main( int argc, const char** argv ) try { - cmd.add( topNArg ); cmd.add( configFileArg ); cmd.add( logFileArg ); @@ -110,7 +107,6 @@ int main( int argc, const char** argv ) configFile = configFileArg.getValue(); logFile = logFileArg.getValue(); - topn = topNArg.getValue(); noDaemon = daemonOffSwitch.getValue(); clockOn = clockSwitch.getValue(); } @@ -177,6 +173,8 @@ int main( int argc, const char** argv ) } std::string country = ini.GetValue("daemon", "country", "us"); + int topn = ini.GetLongValue("daemon", "topn", 20); + bool storePlates = ini.GetBoolValue("daemon", "store_plates", false); std::string imageFolder = ini.GetValue("daemon", "store_plates_location", "/tmp/"); bool uploadData = ini.GetBoolValue("daemon", "upload_data", false);