mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-09 10:20:05 +08:00
Updated detector API to pass in prewarp pointer
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user