Changed library to point to a config file rather than runtime dir

runtime dir location is specified in the config file
This commit is contained in:
Matt Hill
2014-05-10 09:50:52 -05:00
parent cbfa90fc84
commit 66febb8ca8
10 changed files with 110 additions and 41 deletions

View File

@@ -44,7 +44,7 @@ bool measureProcessingTime = false;
int main( int argc, const char** argv )
{
std::string filename;
std::string runtimePath = "";
std::string configFile = "";
bool outputJson = false;
int seektoms = 0;
bool detectRegion = false;
@@ -59,7 +59,7 @@ int main( int argc, const char** argv )
TCLAP::ValueArg<std::string> countryCodeArg("c","country","Country code to identify (either us for USA or eu for Europe). Default=us",false, "us" ,"country_code");
TCLAP::ValueArg<int> seekToMsArg("","seek","Seek to the specied millisecond in a video file. Default=0",false, 0 ,"integer_ms");
TCLAP::ValueArg<std::string> runtimeDirArg("r","runtime_dir","Path to the OpenAlpr runtime data directory",false, "" ,"runtime_dir");
TCLAP::ValueArg<std::string> configFileArg("","config","Path to the openalpr.conf file",false, "" ,"config_file");
TCLAP::ValueArg<std::string> templateRegionArg("t","template_region","Attempt to match the plate number against a region template (e.g., md for Maryland, ca for California)",false, "" ,"region code");
TCLAP::ValueArg<int> topNArg("n","topn","Max number of possible plate numbers to return. Default=10",false, 10 ,"topN");
@@ -69,12 +69,12 @@ int main( int argc, const char** argv )
try
{
cmd.add( fileArg );
cmd.add( countryCodeArg );
cmd.add( templateRegionArg );
cmd.add( seekToMsArg );
cmd.add( topNArg );
cmd.add( runtimeDirArg );
cmd.add( templateRegionArg );
cmd.add( configFileArg );
cmd.add( fileArg );
cmd.add( countryCodeArg );
cmd.parse( argc, argv );
@@ -83,7 +83,7 @@ int main( int argc, const char** argv )
country = countryCodeArg.getValue();
seektoms = seekToMsArg.getValue();
outputJson = jsonSwitch.getValue();
runtimePath = runtimeDirArg.getValue();
configFile = configFileArg.getValue();
detectRegion = detectRegionSwitch.getValue();
templateRegion = templateRegionArg.getValue();
topn = topNArg.getValue();
@@ -98,7 +98,7 @@ int main( int argc, const char** argv )
cv::Mat frame;
Alpr alpr(country, runtimePath);
Alpr alpr(country, configFile);
alpr.setTopN(topn);
if (detectRegion)
@@ -109,7 +109,7 @@ int main( int argc, const char** argv )
if (alpr.isLoaded() == false)
{
std::cerr << "Error loading OpenAlpr" << std::endl;
std::cerr << "Error loading OpenALPR" << std::endl;
return 1;
}