From c25bdf773e094c3bc5cf9441a8a77e5ea27e2c34 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Wed, 18 Mar 2015 18:12:02 -0400 Subject: [PATCH] Using detector mode in detectorfactory --- src/openalpr/detection/detectorfactory.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/openalpr/detection/detectorfactory.cpp b/src/openalpr/detection/detectorfactory.cpp index d8c1f0f..5656e50 100644 --- a/src/openalpr/detection/detectorfactory.cpp +++ b/src/openalpr/detection/detectorfactory.cpp @@ -1,15 +1,16 @@ #include "detectorfactory.h" +#include "detectormorph.h" namespace alpr { Detector* createDetector(Config* config) { - if (config->gpu_mode == 0) + if (config->detector == DETECTOR_LBP_CPU) { // CPU mode return new DetectorCPU(config); } - else if (config->gpu_mode == 1) + else if (config->detector == DETECTOR_LBP_GPU) { #ifdef COMPILE_GPU return new DetectorCUDA(config); @@ -20,6 +21,15 @@ namespace alpr return new DetectorCPU(config); #endif } + else if (config->detector == DETECTOR_MORPH_CPU) + { + return new DetectorMorph(config); + } + else + { + std::cerr << "Unknown detector requested. Using LBP CPU" << std::endl; + return new DetectorCPU(config); + } } }