mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 17:07:39 +08:00
Removed OpenCL region detection code from master branch.
Will merge it back in when the video feature branch is ready
This commit is contained in:
@@ -33,34 +33,6 @@ AlprImpl::AlprImpl(const std::string country, const std::string runtimeDir)
|
||||
this->topN = DEFAULT_TOPN;
|
||||
this->defaultRegion = "";
|
||||
|
||||
if (config->opencl_enabled)
|
||||
{
|
||||
|
||||
cv::ocl::PlatformsInfo platinfo;
|
||||
cv::ocl::getOpenCLPlatforms(platinfo);
|
||||
|
||||
for (int i = 0; i < platinfo.size(); i++)
|
||||
{
|
||||
std::cout << platinfo[i]->platformName << std::endl;
|
||||
}
|
||||
|
||||
cv::ocl::DevicesInfo devices;
|
||||
cv::ocl::getOpenCLDevices(devices, cv::ocl::CVCL_DEVICE_TYPE_CPU);
|
||||
|
||||
for (int i = 0; i < devices.size(); i++)
|
||||
std:: cout << devices[i]->deviceName << std::endl;
|
||||
|
||||
if (devices.size() > 0)
|
||||
{
|
||||
cv::ocl::setDevice(devices[0]);
|
||||
|
||||
cout << "Using OpenCL Device: " << devices[0]->deviceName << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "OpenCL initialization failed. Runtime drivers may not be installed." << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
AlprImpl::~AlprImpl()
|
||||
{
|
||||
|
@@ -38,7 +38,6 @@
|
||||
#include "cjson.h"
|
||||
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include "opencv2/ocl/ocl.hpp"
|
||||
|
||||
|
||||
#include "tinythread/tinythread.h"
|
||||
|
@@ -26,14 +26,8 @@ RegionDetector::RegionDetector(Config* config)
|
||||
this->scale_factor = 1.0f;
|
||||
|
||||
// Load either the regular or OpenCL version of the cascade classifier
|
||||
if (config->opencl_enabled)
|
||||
{
|
||||
this->plate_cascade = new ocl::OclCascadeClassifier();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->plate_cascade = new CascadeClassifier();
|
||||
}
|
||||
|
||||
|
||||
if( this->plate_cascade->load( config->getCascadeRuntimeDir() + config->country + ".xml" ) )
|
||||
{
|
||||
@@ -87,19 +81,12 @@ vector<PlateRegion> RegionDetector::doCascade(Mat frame)
|
||||
Size minSize(config->minPlateSizeWidthPx * this->scale_factor, config->minPlateSizeHeightPx * this->scale_factor);
|
||||
Size maxSize(w * config->maxPlateWidthPercent * this->scale_factor, h * config->maxPlateHeightPercent * this->scale_factor);
|
||||
|
||||
if (config->opencl_enabled)
|
||||
{
|
||||
ocl::oclMat openclFrame(frame);
|
||||
((ocl::OclCascadeClassifier*) plate_cascade)->detectMultiScale(openclFrame, plates, config->detection_iteration_increase, 3, 0, minSize, maxSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
plate_cascade->detectMultiScale( frame, plates, config->detection_iteration_increase, 3,
|
||||
0,
|
||||
//0|CV_HAAR_SCALE_IMAGE,
|
||||
minSize, maxSize );
|
||||
}
|
||||
|
||||
|
||||
if (config->debugTiming)
|
||||
{
|
||||
|
@@ -27,7 +27,6 @@
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/ml/ml.hpp"
|
||||
#include "opencv2/ocl/ocl.hpp"
|
||||
|
||||
#include "utility.h"
|
||||
#include "support/timing.h"
|
||||
|
Reference in New Issue
Block a user