From d18e0e23b0f6532e0e5e55dacfba45881e2a443b Mon Sep 17 00:00:00 2001 From: Philippe Vaucher Date: Fri, 28 Mar 2014 16:14:23 +0100 Subject: [PATCH] Only accept filenames in daemon --- src/main.cpp | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b819992..53e1cd2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -113,37 +113,11 @@ int main( int argc, const char** argv ) if (filename.empty()) { - std::string line; - while (std::getline(std::cin, line)) + std::string filename; + while (std::getline(std::cin, filename)) { - std::istringstream is(line); - std::vector args; - args.push_back("tmp"); - args.insert(args.end(), std::istream_iterator(is), std::istream_iterator()); - try - { - cmd.reset(); - cmd.parse(args); - - filename = fileArg.getValue(); - outputJson = jsonSwitch.getValue(); - detectRegion = detectRegionSwitch.getValue(); - templateRegion = templateRegionArg.getValue(); - topn = topNArg.getValue(); - - alpr.setTopN(topn); - if (detectRegion) - alpr.setDetectRegion(detectRegion); - if (templateRegion.empty() == false) - alpr.setDefaultRegion(templateRegion); - - frame = cv::imread( filename ); - detectandshow( &alpr, frame, "", outputJson); - } - catch (TCLAP::ArgException &e) // catch any exceptions - { - std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; - } + frame = cv::imread( filename ); + detectandshow( &alpr, frame, "", outputJson); } } else if (filename == "webcam")