Updated detector API to pass in prewarp pointer

This commit is contained in:
Matt Hill
2016-03-14 22:26:18 -04:00
parent 8ace033746
commit 9b27f5084e
14 changed files with 237 additions and 15 deletions

View File

@@ -4,12 +4,12 @@
namespace alpr
{
Detector* createDetector(Config* config)
Detector* createDetector(Config* config, PreWarp* prewarp)
{
if (config->detector == DETECTOR_LBP_CPU)
{
// CPU mode
return new DetectorCPU(config);
return new DetectorCPU(config, prewarp);
}
else if (config->detector == DETECTOR_LBP_GPU)
{
@@ -19,13 +19,13 @@ namespace alpr
std::cerr << "Error: GPU detector requested, but GPU extensions are not compiled. " <<
"Add COMPILE_GPU=1 to the compiler definitions to enable GPU compilation." <<
std::endl;
return new DetectorCPU(config);
return new DetectorCPU(config, prewarp);
#endif
}
else if (config->detector == DETECTOR_LBP_OPENCL)
{
#if OPENCV_MAJOR_VERSION == 3
return new DetectorOCL(config);
return new DetectorOCL(config, prewarp);
#else
std::cerr << "Error: OpenCL acceleration requires OpenCV 3.0. " << std::endl;
return new DetectorCPU(config);
@@ -33,12 +33,12 @@ namespace alpr
}
else if (config->detector == DETECTOR_MORPH_CPU)
{
return new DetectorMorph(config);
return new DetectorMorph(config, prewarp);
}
else
{
std::cerr << "Unknown detector requested. Using LBP CPU" << std::endl;
return new DetectorCPU(config);
return new DetectorCPU(config, prewarp);
}
}