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:
Matt Hill
2014-05-06 18:54:33 -05:00
parent 3ab0eaa2bd
commit 4924ba300b
4 changed files with 7 additions and 50 deletions

View File

@@ -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()
{

View File

@@ -38,7 +38,6 @@
#include "cjson.h"
#include <opencv2/core/core.hpp>
#include "opencv2/ocl/ocl.hpp"
#include "tinythread/tinythread.h"

View File

@@ -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();
}
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 );
}
plate_cascade->detectMultiScale( frame, plates, config->detection_iteration_increase, 3,
0,
//0|CV_HAAR_SCALE_IMAGE,
minSize, maxSize );
if (config->debugTiming)
{

View File

@@ -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"