Added support for OpenCL GPU acceleration

This commit is contained in:
Matt Hill
2015-09-12 20:14:13 -04:00
parent 54581ca0e1
commit ec24d1d147
7 changed files with 231 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
#include "detectorfactory.h"
#include "detectormorph.h"
#include "detectorocl.h"
namespace alpr
{
@@ -21,6 +22,15 @@ namespace alpr
return new DetectorCPU(config);
#endif
}
else if (config->detector == DETECTOR_LBP_OPENCL)
{
#if OPENCV_MAJOR_VERSION == 3
return new DetectorOCL(config);
#else
std::cerr << "Error: OpenCL acceleration requires OpenCV 3.0. " << std::endl;
return new DetectorCPU(config);
#endif
}
else if (config->detector == DETECTOR_MORPH_CPU)
{
return new DetectorMorph(config);