Merge branch 2.4

This commit is contained in:
Andrey Kamaev 2013-02-24 20:16:41 +04:00
commit dddd285d3b
29 changed files with 237 additions and 2429 deletions

View File

@ -53,8 +53,8 @@ As usual, after the not-so-lengthy explanation, let's go to the code:
std::cout<<"* Enter alpha [0-1]: "; std::cout<<"* Enter alpha [0-1]: ";
std::cin>>input; std::cin>>input;
/// We use the alpha provided by the user iff it is between 0 and 1 /// We use the alpha provided by the user if it is between 0 and 1
if( alpha >= 0 && alpha <= 1 ) if( input >= 0.0 && input <= 1.0 )
{ alpha = input; } { alpha = input; }
/// Read image ( same size, same type ) /// Read image ( same size, same type )

View File

@ -57,180 +57,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined (HAVE_OPENCL)
/* arithmetics */
void cv::ocl::add(const oclMat &, const oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::add(const oclMat &, const oclMat &, oclMat &, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::add(const oclMat &, const Scalar &, oclMat &, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::subtract(const oclMat &, const oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::subtract(const oclMat &, const oclMat &, oclMat &, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::subtract(const oclMat &, const Scalar &, oclMat &, const oclMat & )
{
throw_nogpu();
}
void cv::ocl::subtract(const Scalar &, const oclMat &, oclMat &, const oclMat & )
{
throw_nogpu();
}
void cv::ocl::multiply(const oclMat &, const oclMat &, oclMat &, double)
{
throw_nogpu();
}
void cv::ocl::divide(const oclMat &, const oclMat &, oclMat &, double)
{
throw_nogpu();
}
void cv::ocl::divide(double, const oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::absdiff(const oclMat &, const oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::absdiff(const oclMat &, const Scalar &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::compare(const oclMat &, const oclMat &, oclMat & , int)
{
throw_nogpu();
}
void cv::ocl::meanStdDev(const oclMat &, Scalar &, Scalar &)
{
throw_nogpu();
}
double cv::ocl::norm(const oclMat &, int)
{
throw_nogpu();
return 0.0;
}
double cv::ocl::norm(const oclMat &, const oclMat &, int)
{
throw_nogpu();
return 0.0;
}
void cv::ocl::flip(const oclMat &, oclMat &, int)
{
throw_nogpu();
}
Scalar cv::ocl::sum(const oclMat &)
{
throw_nogpu();
return Scalar();
}
void cv::ocl::minMax(const oclMat &, double *, double *, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::minMaxLoc(const oclMat &, double *, double *, Point *, Point *, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::LUT(const oclMat &, const Mat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::exp(const oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::log(const oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::magnitude(const oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::phase(const oclMat &, const oclMat &, oclMat &, bool)
{
throw_nogpu();
}
void cv::ocl::cartToPolar(const oclMat &, const oclMat &, oclMat &, oclMat &, bool)
{
throw_nogpu();
}
void cv::ocl::polarToCart(const oclMat &, const oclMat &, oclMat &, oclMat &, bool)
{
throw_nogpu();
}
void cv::ocl::transpose(const oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::pow(const oclMat &, double, oclMat &)
{
throw_nogpu();
}
void cv::ocl::addWeighted(const oclMat &src1, double alpha, const oclMat &src2, double beta, double gama, oclMat &dst)
{
throw_nogpu();
}
void cv::ocl::magnitudeSqr(const oclMat &src1, const oclMat &src2, oclMat &dst)
{
throw_nogpu();
}
/* bit wise operations */
void cv::ocl::bitwise_not(const oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::bitwise_or(const oclMat &, const oclMat &, oclMat &, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::bitwise_and(const oclMat &, const oclMat &, oclMat &, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::bitwise_and(const oclMat &, const Scalar &, oclMat &, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::bitwise_xor(const oclMat &, const oclMat &, oclMat &, const oclMat &)
{
throw_nogpu();
}
cv::ocl::oclMat cv::ocl::operator ~ (const oclMat &)
{
throw_nogpu();
return oclMat();
}
cv::ocl::oclMat cv::ocl::operator | (const oclMat &, const oclMat &)
{
throw_nogpu();
return oclMat();
}
cv::ocl::oclMat cv::ocl::operator & (const oclMat &, const oclMat &)
{
throw_nogpu();
return oclMat();
}
cv::ocl::oclMat cv::ocl::operator ^ (const oclMat &, const oclMat &)
{
throw_nogpu();
return oclMat();
}
#else /* !defined (HAVE_OPENCL) */
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -2477,5 +2303,3 @@ void cv::ocl::pow(const oclMat &x, double p, oclMat &y)
arithmetic_pow_run(x, p, y, kernelName, &arithm_pow); arithmetic_pow_run(x, p, y, kernelName, &arithm_pow);
} }
#endif /* !defined (HAVE_OPENCL) */

View File

@ -50,17 +50,6 @@ using namespace std;
using std::cout; using std::cout;
using std::endl; using std::endl;
#if !defined (HAVE_OPENCL)
namespace cv
{
namespace ocl
{
//nothing
}//namespace ocl
}//namespace cv
#else /* !defined (HAVE_OPENCL) */
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -99,4 +88,3 @@ namespace cv
}//namespace ocl }//namespace ocl
}//namespace cv }//namespace cv
#endif

View File

@ -50,13 +50,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined (HAVE_OPENCL)
void cv::ocl::blendLinear(const oclMat &img1, const oclMat &img2, const oclMat &weights1, const oclMat &weights2,
oclMat &result)
{
throw_nogpu();
}
#else
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -98,4 +91,3 @@ void cv::ocl::blendLinear(const oclMat &img1, const oclMat &img2, const oclMat &
openCLExecuteKernel(ctx, &blend_linear, kernelName, globalSize, localSize, args, channels, depth); openCLExecuteKernel(ctx, &blend_linear, kernelName, globalSize, localSize, args, channels, depth);
} }
} }
#endif

View File

@ -51,136 +51,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined (HAVE_OPENCL)
cv::ocl::BruteForceMatcher_OCL_base::BruteForceMatcher_OCL_base(DistType)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::add(const vector<oclMat> &)
{
throw_nogpu();
}
const vector<oclMat> &cv::ocl::BruteForceMatcher_OCL_base::getTrainDescriptors() const
{
throw_nogpu();
return trainDescCollection;
}
void cv::ocl::BruteForceMatcher_OCL_base::clear()
{
throw_nogpu();
}
bool cv::ocl::BruteForceMatcher_OCL_base::empty() const
{
throw_nogpu();
return true;
}
bool cv::ocl::BruteForceMatcher_OCL_base::isMaskSupported() const
{
throw_nogpu();
return true;
}
void cv::ocl::BruteForceMatcher_OCL_base::matchSingle(const oclMat &, const oclMat &, oclMat &, oclMat &, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::matchDownload(const oclMat &, const oclMat &, vector<DMatch> &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::matchConvert(const Mat &, const Mat &, vector<DMatch> &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::match(const oclMat &, const oclMat &, vector<DMatch> &, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::makeGpuCollection(oclMat &, oclMat &, const vector<oclMat> &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::matchCollection(const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat &, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::matchDownload(const oclMat &, const oclMat &, const oclMat &, vector<DMatch> &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::matchConvert(const Mat &, const Mat &, const Mat &, vector<DMatch> &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::match(const oclMat &, vector<DMatch> &, const vector<oclMat> &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::knnMatchSingle(const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat &, int, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::knnMatchDownload(const oclMat &, const oclMat &, vector< vector<DMatch> > &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::knnMatchConvert(const Mat &, const Mat &, vector< vector<DMatch> > &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat &, const oclMat &, vector< vector<DMatch> > &, int, const oclMat &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::knnMatch2Collection(const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat &, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::knnMatch2Download(const oclMat &, const oclMat &, const oclMat &, vector< vector<DMatch> > &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::knnMatch2Convert(const Mat &, const Mat &, const Mat &, vector< vector<DMatch> > &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat &, vector< vector<DMatch> > &, int, const vector<oclMat> &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchSingle(const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat &, float, const oclMat &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchDownload(const oclMat &, const oclMat &, const oclMat &, vector< vector<DMatch> > &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchConvert(const Mat &, const Mat &, const Mat &, vector< vector<DMatch> > &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::radiusMatch(const oclMat &, const oclMat &, vector< vector<DMatch> > &, float, const oclMat &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchCollection(const oclMat &, oclMat &, oclMat &, oclMat &, oclMat &, float, const vector<oclMat> &)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchDownload(const oclMat &, const oclMat &, const oclMat &, const oclMat &, vector< vector<DMatch> > &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::radiusMatchConvert(const Mat &, const Mat &, const Mat &, const Mat &, vector< vector<DMatch> > &, bool)
{
throw_nogpu();
}
void cv::ocl::BruteForceMatcher_OCL_base::radiusMatch(const oclMat &, vector< vector<DMatch> > &, float, const vector<oclMat> &, bool)
{
throw_nogpu();
}
#else /* !defined (HAVE_OPENCL) */
using namespace std; using namespace std;
namespace cv namespace cv
{ {
@ -1827,7 +1697,3 @@ void cv::ocl::BruteForceMatcher_OCL_base::radiusMatch(const oclMat &query, vecto
radiusMatchCollection(query, trainIdx, imgIdx, distance, nMatches, maxDistance, masks); radiusMatchCollection(query, trainIdx, imgIdx, distance, nMatches, maxDistance, masks);
radiusMatchDownload(trainIdx, imgIdx, distance, nMatches, matches, compactResult); radiusMatchDownload(trainIdx, imgIdx, distance, nMatches, matches, compactResult);
} }
#endif

View File

@ -49,21 +49,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined (HAVE_OPENCL)
void cv::ocl::buildWarpPlaneMaps(Size, Rect, const Mat &, const Mat &, const Mat &, float, oclMat &, oclMat &, Stream &)
{
throw_nogpu();
}
void cv::ocl::buildWarpCylindricalMaps(Size, Rect, const Mat &, const Mat &, float, oclMat &, oclMat &, Stream &)
{
throw_nogpu();
}
void cv::ocl::buildWarpSphericalMaps(Size, Rect, const Mat &, const Mat &, float, oclMat &, oclMat &, Stream &)
{
throw_nogpu();
}
#else
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -275,6 +260,3 @@ void cv::ocl::buildWarpPerspectiveMaps(const Mat &M, bool inverse, Size dsize, o
size_t localThreads[3] = {32, 8, 1}; size_t localThreads[3] = {32, 8, 1};
openCLExecuteKernel(clCxt, &build_warps, kernelName, globalThreads, localThreads, args, -1, -1); openCLExecuteKernel(clCxt, &build_warps, kernelName, globalThreads, localThreads, args, -1, -1);
} }
#endif // HAVE_OPENCL

View File

@ -51,25 +51,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined (HAVE_OPENCL)
void cv::ocl::Canny(const oclMat &image, oclMat &edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false)
{
throw_nogpu();
}
void cv::ocl::Canny(const oclMat &image, CannyBuf &buf, oclMat &edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false)
{
throw_nogpu();
}
void cv::ocl::Canny(const oclMat &dx, const oclMat &dy, oclMat &edges, double low_thresh, double high_thresh, bool L2gradient = false)
{
throw_nogpu();
}
void cv::ocl::Canny(const oclMat &dx, const oclMat &dy, CannyBuf &buf, oclMat &edges, double low_thresh, double high_thresh, bool L2gradient = false)
{
throw_nogpu();
}
#else
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -426,5 +407,3 @@ void canny::getEdges_gpu(oclMat &map, oclMat &dst, int rows, int cols)
openCLExecuteKernel2(clCxt, &imgproc_canny, kernelName, globalThreads, localThreads, args, -1, -1); openCLExecuteKernel2(clCxt, &imgproc_canny, kernelName, globalThreads, localThreads, args, -1, -1);
} }
#endif // HAVE_OPENCL

View File

@ -49,18 +49,6 @@
using namespace cv; using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
#if !defined (HAVE_OPENCL)
void cv::ocl::cvtColor(const oclMat &, oclMat &, int, int)
{
throw_nogpu();
}
void cv::ocl::cvtColor(const oclMat &, oclMat &, int, int, const Stream &)
{
throw_nogpu();
}
#else /* !defined (HAVE_OPENCL) */
#ifndef CV_DESCALE #ifndef CV_DESCALE
#define CV_DESCALE(x, n) (((x) + (1 << ((n)-1))) >> (n)) #define CV_DESCALE(x, n) (((x) + (1 << ((n)-1))) >> (n))
#endif #endif
@ -289,5 +277,3 @@ void cv::ocl::cvtColor(const oclMat &src, oclMat &dst, int code, int dcn)
{ {
cvtColor_caller(src, dst, code, dcn); cvtColor_caller(src, dst, code, dcn);
} }
#endif /* !defined (HAVE_OPENCL) */

View File

@ -50,16 +50,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined(HAVE_OPENCL)
void cv::ocl::columnSum(const oclMat &src, oclMat &dst)
{
throw_nogpu();
}
#else /*!HAVE_OPENCL */
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -93,4 +83,3 @@ void cv::ocl::columnSum(const oclMat &src, oclMat &dst)
openCLExecuteKernel(clCxt, &imgproc_columnsum, kernelName, globalThreads, localThreads, args, src.channels(), src.depth()); openCLExecuteKernel(clCxt, &imgproc_columnsum, kernelName, globalThreads, localThreads, args, src.channels(), src.depth());
} }
#endif

View File

@ -46,12 +46,6 @@
using namespace cv; using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
#if !defined (HAVE_OPENCL)
// do nothing
#else /* !defined (HAVE_OPENCL) */
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -194,5 +188,3 @@ namespace cv
} }
} }
} }
#endif

View File

@ -49,12 +49,7 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined HAVE_OPENCL #if !defined HAVE_CLAMDFFT
void cv::ocl::dft(const oclMat &, oclMat &, Size , int )
{
throw_nogpu();
}
#elif !defined HAVE_CLAMDFFT
void cv::ocl::dft(const oclMat&, oclMat&, Size, int) void cv::ocl::dft(const oclMat&, oclMat&, Size, int)
{ {
CV_Error(CV_StsNotImplemented, "OpenCL DFT is not implemented"); CV_Error(CV_StsNotImplemented, "OpenCL DFT is not implemented");

View File

@ -54,121 +54,6 @@ using namespace std;
using namespace cv; using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
#if !defined (HAVE_OPENCL)
Ptr<BaseFilter_GPU> cv::ocl::getBoxFilter_GPU(int, int, const Size &, Point, int)
{
throw_nogpu();
return Ptr<BaseFilter_GPU>(0);
}
Ptr<FilterEngine_GPU> cv::ocl::createBoxFilter_GPU(int, int, const Size &, const Point &, int)
{
throw_nogpu();
return Ptr<FilterEngine_GPU>(0);
}
Ptr<FilterEngine_GPU> cv::ocl::createFilter2D_GPU(const Ptr<BaseFilter_GPU>)
{
throw_nogpu();
return Ptr<FilterEngine_GPU>(0);
}
Ptr<FilterEngine_GPU> cv::ocl::createSeparableLinearFilter_GPU(int, int, const Mat &, const Mat &, const Point &)
{
throw_nogpu();
return Ptr<FilterEngine_GPU>(0);
}
Ptr<BaseRowFilter_GPU> cv::ocl::getLinearRowFilter_GPU(int, int, const Mat &, int)
{
throw_nogpu();
return Ptr<BaseRowFilter_GPU>(0);
}
Ptr<BaseColumnFilter_GPU> cv::ocl::getLinearColumnFilter_GPU(int, int, const Mat &, int)
{
throw_nogpu();
return Ptr<BaseColumnFilter_GPU>(0);
}
Ptr<FilterEngine_GPU> cv::ocl::createGaussianFilter_GPU(int, Size, double, double)
{
throw_nogpu();
return Ptr<FilterEngine_GPU>(0);
}
Ptr<BaseFilter_GPU> cv::ocl::getLinearFilter_GPU(int, int, const Mat &, const Size &, Point)
{
throw_nogpu();
return Ptr<BaseFilter_GPU>(0);
}
Ptr<FilterEngine_GPU> cv::ocl::createLinearFilter_GPU(int, int, const Mat &, const Point &)
{
throw_nogpu();
return Ptr<FilterEngine_GPU>(0);
}
Ptr<FilterEngine_GPU> cv::ocl::createDerivFilter_GPU(int srcType, int dstType, int dx, int dy, int ksize, int borderType)
{
throw_nogpu();
return Ptr<FilterEngine_GPU>(0);
}
void cv::ocl::boxFilter(const oclMat &, oclMat &, int, Size, Point, int)
{
throw_nogpu();
}
void cv::ocl::sepFilter2D(const oclMat &, oclMat &, int, const Mat &, const Mat &, Point)
{
throw_nogpu();
}
void cv::ocl::Sobel(const oclMat &, oclMat &, int, int, int, int, double)
{
throw_nogpu();
}
void cv::ocl::Scharr(const oclMat &, oclMat &, int, int, int, double)
{
throw_nogpu();
}
void cv::ocl::GaussianBlur(const oclMat &, oclMat &, Size, double, double)
{
throw_nogpu();
}
void cv::ocl::filter2D(const oclMat &, oclMat &, int, const Mat &, Point)
{
throw_nogpu();
}
void cv::ocl::Laplacian(const oclMat &, oclMat &, int, int, double)
{
throw_nogpu();
}
void cv::ocl::erode(const oclMat &, oclMat &, const Mat &, Point, int)
{
throw_nogpu();
}
void cv::ocl::dilate(const oclMat &, oclMat &, const Mat &, Point, int)
{
throw_nogpu();
}
void cv::ocl::morphologyEx(const oclMat &, oclMat &, int, const Mat &, Point, int)
{
throw_nogpu();
}
#else /* !defined (HAVE_OPENCL) */
//helper routines //helper routines
namespace cv namespace cv
{ {
@ -1705,5 +1590,3 @@ void cv::ocl::GaussianBlur(const oclMat &src, oclMat &dst, Size ksize, double si
Ptr<FilterEngine_GPU> f = createGaussianFilter_GPU(src.type(), ksize, sigma1, sigma2, bordertype); Ptr<FilterEngine_GPU> f = createGaussianFilter_GPU(src.type(), ksize, sigma1, sigma2, bordertype);
f->apply(src, dst); f->apply(src, dst);
} }
#endif /* !defined (HAVE_OPENCL) */

View File

@ -46,24 +46,14 @@
#include <iomanip> #include <iomanip>
#include "precomp.hpp" #include "precomp.hpp"
#ifdef HAVE_CLAMDBLAS #if !defined HAVE_CLAMDBLAS
void cv::ocl::gemm(const oclMat&, const oclMat&, double,
#include "clAmdBlas.h" const oclMat&, double, oclMat&, int)
#if !defined HAVE_OPENCL
void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha,
const oclMat &src3, double beta, oclMat &dst, int flags)
{
throw_nogpu();
}
#elif !defined HAVE_CLAMDBLAS
void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha,
const oclMat &src3, double beta, oclMat &dst, int flags)
{ {
CV_Error(CV_StsNotImplemented, "OpenCL BLAS is not implemented"); CV_Error(CV_StsNotImplemented, "OpenCL BLAS is not implemented");
} }
#else #else
#include "clAmdBlas.h"
using namespace cv; using namespace cv;
void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha, void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha,
@ -168,4 +158,3 @@ void cv::ocl::gemm(const oclMat &src1, const oclMat &src2, double alpha,
clAmdBlasTeardown(); clAmdBlasTeardown();
} }
#endif #endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -49,69 +49,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined (HAVE_OPENCL)
cv::ocl::HOGDescriptor::HOGDescriptor(Size, Size, Size, Size, int, double, double, bool, int)
{
throw_nogpu();
}
size_t cv::ocl::HOGDescriptor::getDescriptorSize() const
{
throw_nogpu();
return 0;
}
size_t cv::ocl::HOGDescriptor::getBlockHistogramSize() const
{
throw_nogpu();
return 0;
}
double cv::ocl::HOGDescriptor::getWinSigma() const
{
throw_nogpu();
return 0;
}
bool cv::ocl::HOGDescriptor::checkDetectorSize() const
{
throw_nogpu();
return false;
}
void cv::ocl::HOGDescriptor::setSVMDetector(const vector<float> &)
{
throw_nogpu();
}
void cv::ocl::HOGDescriptor::detect(const oclMat &, vector<Point> &, double, Size, Size)
{
throw_nogpu();
}
void cv::ocl::HOGDescriptor::detectMultiScale(const oclMat &, vector<Rect> &, double, Size, Size, double, int)
{
throw_nogpu();
}
void cv::ocl::HOGDescriptor::computeBlockHistograms(const oclMat &)
{
throw_nogpu();
}
void cv::ocl::HOGDescriptor::getDescriptors(const oclMat &, Size, oclMat &, int)
{
throw_nogpu();
}
std::vector<float> cv::ocl::HOGDescriptor::getDefaultPeopleDetector()
{
throw_nogpu();
return std::vector<float>();
}
std::vector<float> cv::ocl::HOGDescriptor::getPeopleDetector48x96()
{
throw_nogpu();
return std::vector<float>();
}
std::vector<float> cv::ocl::HOGDescriptor::getPeopleDetector64x128()
{
throw_nogpu();
return std::vector<float>();
}
#else
#define CELL_WIDTH 8 #define CELL_WIDTH 8
#define CELL_HEIGHT 8 #define CELL_HEIGHT 8
@ -1895,5 +1832,3 @@ void cv::ocl::device::hog::resize( const oclMat &src, oclMat &dst, const Size sz
openCLExecuteKernel2(clCxt, &objdetect_hog, kernelName, globalThreads, localThreads, args, -1, -1); openCLExecuteKernel2(clCxt, &objdetect_hog, kernelName, globalThreads, localThreads, args, -1, -1);
} }
#endif

View File

@ -59,62 +59,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined (HAVE_OPENCL)
void cv::ocl::meanShiftFiltering(const oclMat &, oclMat &, int, int, TermCriteria)
{
throw_nogpu();
}
void cv::ocl::meanShiftProc(const oclMat &, oclMat &, oclMat &, int, int, TermCriteria)
{
throw_nogpu();
}
double cv::ocl::threshold(const oclMat &, oclMat &, double, int)
{
throw_nogpu();
return 0.0;
}
void cv::ocl::resize(const oclMat &, oclMat &, Size, double, double, int)
{
throw_nogpu();
}
void cv::ocl::remap(const oclMat &, oclMat &, oclMat &, oclMat &, int, int , const Scalar &)
{
throw_nogpu();
}
void cv::ocl::copyMakeBorder(const oclMat &, oclMat &, int, int, int, int, const Scalar &)
{
throw_nogpu();
}
void cv::ocl::warpAffine(const oclMat &, oclMat &, const Mat &, Size, int)
{
throw_nogpu();
}
void cv::ocl::warpPerspective(const oclMat &, oclMat &, const Mat &, Size, int)
{
throw_nogpu();
}
void cv::ocl::integral(const oclMat &, oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::calcHist(const oclMat &, oclMat &hist)
{
throw_nogpu();
}
void cv::ocl::bilateralFilter(const oclMat &, oclMat &, int, double, double, int)
{
throw_nogpu();
}
void cv::ocl::convolve(const oclMat &, const oclMat &, oclMat &)
{
throw_nogpu();
}
#else /* !defined (HAVE_OPENCL) */
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -1696,4 +1640,3 @@ void cv::ocl::convolve(const oclMat &x, const oclMat &t, oclMat &y)
convolve_run(x, t, y, kernelName, &imgproc_convolve); convolve_run(x, t, y, kernelName, &imgproc_convolve);
} }
#endif /* !defined (HAVE_OPENCL) */

View File

@ -61,82 +61,6 @@ using std::endl;
//#define AMD_DOUBLE_DIFFER //#define AMD_DOUBLE_DIFFER
#if !defined (HAVE_OPENCL)
namespace cv
{
namespace ocl
{
cl_device_id getDevice()
{
throw_nogpu();
return 0;
}
void getComputeCapability(cl_device_id, int &major, int &minor)
{
throw_nogpu();
}
void openCLMallocPitch(Context * /*clCxt*/, void ** /*dev_ptr*/, size_t * /*pitch*/,
size_t /*widthInBytes*/, size_t /*height*/)
{
throw_nogpu();
}
void openCLMemcpy2D(Context * /*clCxt*/, void * /*dst*/, size_t /*dpitch*/,
const void * /*src*/, size_t /*spitch*/,
size_t /*width*/, size_t /*height*/, enum openCLMemcpyKind /*kind*/)
{
throw_nogpu();
}
void openCLCopyBuffer2D(Context * /*clCxt*/, void * /*dst*/, size_t /*dpitch*/,
const void * /*src*/, size_t /*spitch*/,
size_t /*width*/, size_t /*height*/, enum openCLMemcpyKind /*kind*/)
{
throw_nogpu();
}
cl_mem openCLCreateBuffer(Context *, size_t, size_t)
{
throw_nogpu();
}
void openCLReadBuffer(Context *, cl_mem, void *, size_t)
{
throw_nogpu();
}
void openCLFree(void * /*devPtr*/)
{
throw_nogpu();
}
cl_kernel openCLGetKernelFromSource(const Context * /*clCxt*/,
const char ** /*fileName*/, string /*kernelName*/)
{
throw_nogpu();
}
void openCLVerifyKernel(const Context * /*clCxt*/, cl_kernel /*kernel*/, size_t * /*blockSize*/,
size_t * /*globalThreads*/, size_t * /*localThreads*/)
{
throw_nogpu();
}
cl_mem load_constant(cl_context context, cl_command_queue command_queue, const void *value,
const size_t size)
{
throw_nogpu();
}
}//namespace ocl
}//namespace cv
#else /* !defined (HAVE_OPENCL) */
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -1013,4 +937,3 @@ namespace cv
}//namespace ocl }//namespace ocl
}//namespace cv }//namespace cv
#endif

View File

@ -50,17 +50,6 @@ using namespace std;
using namespace cv; using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
#if !defined (HAVE_OPENCL)
void cv::ocl::interpolateFrames(const oclMat &frame0, const oclMat &frame1,
const oclMat &fu, const oclMat &fv,
const oclMat &bu, const oclMat &bv,
float pos, oclMat &newFrame, oclMat &buf)
{
throw_nogpu();
}
#else
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -311,5 +300,4 @@ void interpolate::bindImgTex(const oclMat &img, cl_mem &texture)
clEnqueueCopyBufferToImage(img.clCxt->impl->clCmdQueue, (cl_mem)img.data, texture, 0, origin, region, 0, NULL, 0); clEnqueueCopyBufferToImage(img.clCxt->impl->clCmdQueue, (cl_mem)img.data, texture, 0, origin, region, 0, NULL, 0);
openCLSafeCall(err); openCLSafeCall(err);
} }
#endif//(HAVE_OPENCL)

View File

@ -9,6 +9,7 @@
// Niko Li, newlife20080214@gmail.com // Niko Li, newlife20080214@gmail.com
// Wang Weiyan, wangweiyanster@gmail.com // Wang Weiyan, wangweiyanster@gmail.com
// Jia Haipeng, jiahaipeng95@gmail.com // Jia Haipeng, jiahaipeng95@gmail.com
// Nathan, liujun@multicorewareinc.com
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
// //
@ -299,6 +300,7 @@ __kernel void __attribute__((reqd_work_group_size(8,8,1)))gpuRunHaarClassifierCa
} }
barrier(CLK_LOCAL_MEM_FENCE); barrier(CLK_LOCAL_MEM_FENCE);
int queuecount = lclcount[0]; int queuecount = lclcount[0];
barrier(CLK_LOCAL_MEM_FENCE);
nodecounter = splitnode; nodecounter = splitnode;
for(int stageloop = split_stage; stageloop< end_stage && queuecount>0; stageloop++) for(int stageloop = split_stage; stageloop< end_stage && queuecount>0; stageloop++)
{ {
@ -324,7 +326,8 @@ __kernel void __attribute__((reqd_work_group_size(8,8,1)))gpuRunHaarClassifierCa
int queue_pixel = mad24(((temp_coord & (int)0xffff0000)>>16),readwidth,temp_coord & 0xffff); int queue_pixel = mad24(((temp_coord & (int)0xffff0000)>>16),readwidth,temp_coord & 0xffff);
//barrier(CLK_LOCAL_MEM_FENCE); //barrier(CLK_LOCAL_MEM_FENCE);
if(lcl_compute_win_id < queuecount) { if(lcl_compute_win_id < queuecount)
{
int tempnodecounter = lcl_compute_id; int tempnodecounter = lcl_compute_id;
float part_sum = 0.f; float part_sum = 0.f;
@ -363,7 +366,8 @@ __kernel void __attribute__((reqd_work_group_size(8,8,1)))gpuRunHaarClassifierCa
partialsum[lcl_id]=part_sum; partialsum[lcl_id]=part_sum;
} }
barrier(CLK_LOCAL_MEM_FENCE); barrier(CLK_LOCAL_MEM_FENCE);
if(lcl_compute_win_id < queuecount) { if(lcl_compute_win_id < queuecount)
{
for(int i=0; i<lcl_compute_win && (lcl_compute_id==0); i++) for(int i=0; i<lcl_compute_win && (lcl_compute_id==0); i++)
{ {
stage_sum += partialsum[lcl_id+i]; stage_sum += partialsum[lcl_id+i];
@ -378,8 +382,9 @@ __kernel void __attribute__((reqd_work_group_size(8,8,1)))gpuRunHaarClassifierCa
} }
barrier(CLK_LOCAL_MEM_FENCE); barrier(CLK_LOCAL_MEM_FENCE);
}//end for(int queueloop=0;queueloop<queuecount_loop;queueloop++) }//end for(int queueloop=0;queueloop<queuecount_loop;queueloop++)
barrier(CLK_LOCAL_MEM_FENCE); //barrier(CLK_LOCAL_MEM_FENCE);
queuecount = lclcount[0]; queuecount = lclcount[0];
barrier(CLK_LOCAL_MEM_FENCE);
nodecounter += stageinfo.x; nodecounter += stageinfo.x;
}//end for(int stageloop = splitstage; stageloop< endstage && queuecount>0;stageloop++) }//end for(int stageloop = splitstage; stageloop< endstage && queuecount>0;stageloop++)
//barrier(CLK_LOCAL_MEM_FENCE); //barrier(CLK_LOCAL_MEM_FENCE);

View File

@ -51,12 +51,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined (HAVE_OPENCL)
void cv::ocl::matchTemplate(const oclMat &, const oclMat &, oclMat &)
{
throw_nogpu();
}
#else
//helper routines //helper routines
namespace cv namespace cv
{ {
@ -498,4 +492,3 @@ void cv::ocl::matchTemplate(const oclMat &image, const oclMat &templ, oclMat &re
CV_Assert(caller); CV_Assert(caller);
caller(image, templ, result, buf); caller(image, templ, result, buf);
} }
#endif //

View File

@ -58,60 +58,6 @@ using namespace std;
//////////////////////////////// oclMat //////////////////////////////// //////////////////////////////// oclMat ////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
#if !defined (HAVE_OPENCL)
namespace cv
{
namespace ocl
{
void oclMat::upload(const Mat & /*m*/)
{
throw_nogpu();
}
void oclMat::download(cv::Mat & /*m*/) const
{
throw_nogpu();
}
void oclMat::copyTo( oclMat & /*m*/ ) const
{
throw_nogpu();
}
void oclMat::copyTo( oclMat & /*m*/, const oclMat &/* mask */) const
{
throw_nogpu();
}
void oclMat::convertTo( oclMat & /*m*/, int /*rtype*/, double /*alpha*/, double /*beta*/ ) const
{
throw_nogpu();
}
oclMat &oclMat::operator = (const Scalar & /*s*/)
{
throw_nogpu();
return *this;
}
oclMat &oclMat::setTo(const Scalar & /*s*/, const oclMat & /*mask*/)
{
throw_nogpu();
return *this;
}
oclMat oclMat::reshape(int /*new_cn*/, int /*new_rows*/) const
{
throw_nogpu();
return oclMat();
}
void oclMat::create(int /*_rows*/, int /*_cols*/, int /*_type*/)
{
throw_nogpu();
}
void oclMat::release()
{
throw_nogpu();
}
}
}
#else /* !defined (HAVE_OPENCL) */
//helper routines //helper routines
namespace cv namespace cv
{ {
@ -1045,4 +991,3 @@ oclMat& cv::ocl::oclMat::operator/=( const oclMat& m )
divide(*this, m, *this); divide(*this, m, *this);
return *this; return *this;
} }
#endif /* !defined (HAVE_OPENCL) */

View File

@ -47,9 +47,6 @@
#define _OPENCV_MCWUTIL_ #define _OPENCV_MCWUTIL_
#include "precomp.hpp" #include "precomp.hpp"
#if defined (HAVE_OPENCL)
using namespace std; using namespace std;
namespace cv namespace cv
@ -76,5 +73,5 @@ namespace cv
}//namespace ocl }//namespace ocl
}//namespace cv }//namespace cv
#endif // HAVE_OPENCL
#endif //_OPENCV_MCWUTIL_ #endif //_OPENCV_MCWUTIL_

View File

@ -44,23 +44,6 @@
#include "precomp.hpp" #include "precomp.hpp"
#if !defined(HAVE_OPENCL)
namespace cv
{
namespace ocl
{
void meanShiftSegmentation(const oclMat &, Mat &, int, int, int, TermCriteria)
{
throw_nogpu();
}
}
}
#else
using namespace std; using namespace std;
// Auxiliray stuff // Auxiliray stuff
@ -411,4 +394,3 @@ namespace cv
} }
} }
#endif // #if !defined (HAVE_OPENCL)

View File

@ -52,13 +52,6 @@ using namespace std;
using namespace cv; using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
#if !defined (HAVE_OPENCL)
void cv::ocl::PyrLKOpticalFlow::sparse(const oclMat &, const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat &) { }
void cv::ocl::PyrLKOpticalFlow::dense(const oclMat &, const oclMat &, oclMat &, oclMat &, oclMat *) { }
#else /* !defined (HAVE_OPENCL) */
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -862,5 +855,3 @@ void cv::ocl::PyrLKOpticalFlow::dense(const oclMat &prevImg, const oclMat &nextI
clFinish(prevImg.clCxt->impl->clCmdQueue); clFinish(prevImg.clCxt->impl->clCmdQueue);
} }
#endif /* !defined (HAVE_CUDA) */

View File

@ -54,13 +54,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#ifndef HAVE_OPENCL
void cv::ocl::pyrUp(const oclMat &, GpuMat &, oclMat &)
{
throw_nogpu();
}
#else
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -93,5 +86,4 @@ namespace cv
openCLExecuteKernel(clCxt, &pyr_up, kernelName, globalThreads, localThreads, args, src.oclchannels(), src.depth()); openCLExecuteKernel(clCxt, &pyr_up, kernelName, globalThreads, localThreads, args, src.oclchannels(), src.depth());
} }
} }
}; }
#endif // HAVE_OPENCL

View File

@ -58,34 +58,6 @@ using std::endl;
///////////////// oclMat merge and split /////////////////////////////// ///////////////// oclMat merge and split ///////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
#if !defined (HAVE_OPENCL)
namespace cv
{
namespace ocl
{
void cv::ocl::merge(const oclMat *src_mat, size_t count, oclMat &dst_mat)
{
throw_nogpu();
}
void cv::ocl::merge(const vector<oclMat> &src_mat, oclMat &dst_mat)
{
throw_nogpu();
}
void cv::ocl::split(const oclMat &src, oclMat *dst)
{
throw_nogpu();
}
void cv::ocl::split(const oclMat &src, vector<oclMat> &dst)
{
throw_nogpu();
}
}
}
#else /* !defined (HAVE_OPENCL) */
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -417,4 +389,3 @@ void cv::ocl::split(const oclMat &src, vector<oclMat> &dst)
if(src.oclchannels() > 0) if(src.oclchannels() > 0)
split_merge::split(src, &dst[0]); split_merge::split(src, &dst[0]);
} }
#endif /* !defined (HAVE_OPENCL) */

View File

@ -50,59 +50,6 @@ using namespace cv;
using namespace cv::ocl; using namespace cv::ocl;
using namespace std; using namespace std;
#if !defined (HAVE_OPENCL)
cv::ocl::SURF_OCL::SURF_OCL()
{
throw_nogpu();
}
cv::ocl::SURF_OCL::SURF_OCL(double, int, int, bool, float, bool)
{
throw_nogpu();
}
int cv::ocl::SURF_OCL::descriptorSize() const
{
throw_nogpu();
return 0;
}
void cv::ocl::SURF_OCL::uploadKeypoints(const vector<KeyPoint> &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::SURF_OCL::downloadKeypoints(const oclMat &, vector<KeyPoint> &)
{
throw_nogpu();
}
void cv::ocl::SURF_OCL::downloadDescriptors(const oclMat &, vector<float> &)
{
throw_nogpu();
}
void cv::ocl::SURF_OCL::operator()(const oclMat &, const oclMat &, oclMat &)
{
throw_nogpu();
}
void cv::ocl::SURF_OCL::operator()(const oclMat &, const oclMat &, oclMat &, oclMat &, bool)
{
throw_nogpu();
}
void cv::ocl::SURF_OCL::operator()(const oclMat &, const oclMat &, vector<KeyPoint> &)
{
throw_nogpu();
}
void cv::ocl::SURF_OCL::operator()(const oclMat &, const oclMat &, vector<KeyPoint> &, oclMat &, bool)
{
throw_nogpu();
}
void cv::ocl::SURF_OCL::operator()(const oclMat &, const oclMat &, vector<KeyPoint> &, vector<float> &, bool)
{
throw_nogpu();
}
void cv::ocl::SURF_OCL::releaseMemory()
{
throw_nogpu();
}
#else /* !defined (HAVE_OPENCL) */
namespace cv namespace cv
{ {
namespace ocl namespace ocl
@ -755,5 +702,3 @@ void SURF_OCL_Invoker::compute_descriptors_gpu(const oclMat &descriptors, const
} }
} }
#endif // /* !defined (HAVE_OPENCL) */

View File

@ -791,8 +791,8 @@ TEST_P(WarpAffine, Mat)
{ {
static const double coeffs[2][3] = static const double coeffs[2][3] =
{ {
{cos(3.14 / 6), -sin(3.14 / 6), 100.0}, {cos(CV_PI / 6), -sin(CV_PI / 6), 100.0},
{sin(3.14 / 6), cos(3.14 / 6), -100.0} {sin(CV_PI / 6), cos(CV_PI / 6), -100.0}
}; };
Mat M(2, 3, CV_64F, (void *)coeffs); Mat M(2, 3, CV_64F, (void *)coeffs);

View File

@ -44,7 +44,7 @@
#include "precomp.hpp" #include "precomp.hpp"
//#define PERF_TEST 0
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// MatchTemplate // MatchTemplate
@ -97,15 +97,7 @@ TEST_P(MatchTemplate8U, Accuracy)
cv::Mat mat_dst; cv::Mat mat_dst;
dst.download(mat_dst); dst.download(mat_dst);
EXPECT_MAT_NEAR(dst_gold, mat_dst, templ_size.area() * 1e-1, sss); EXPECT_MAT_NEAR(dst_gold, mat_dst, templ_size.area() * 1e-1, sss);
#ifdef PERF_TEST
{
P_TEST_FULL( {}, {cv::ocl::matchTemplate(ocl_image, ocl_templ, dst, method);}, {});
P_TEST_FULL( {}, {cv::matchTemplate(image, templ, dst_gold, method);}, {});
}
#endif // PERF_TEST
} }
PARAM_TEST_CASE(MatchTemplate32F, cv::Size, TemplateSize, Channels, TemplateMethod) PARAM_TEST_CASE(MatchTemplate32F, cv::Size, TemplateSize, Channels, TemplateMethod)
@ -144,17 +136,6 @@ TEST_P(MatchTemplate32F, Accuracy)
dst.download(mat_dst); dst.download(mat_dst);
EXPECT_MAT_NEAR(dst_gold, mat_dst, templ_size.area() * 1e-1, sss); EXPECT_MAT_NEAR(dst_gold, mat_dst, templ_size.area() * 1e-1, sss);
#ifdef PERF_TEST
{
std::cout << "Method: " << TEMPLATE_METHOD_NAMES[method] << std::endl;
std::cout << "Image Size: (" << size.width << ", " << size.height << ")" << std::endl;
std::cout << "Template Size: (" << templ_size.width << ", " << templ_size.height << ")" << std::endl;
std::cout << "Channels: " << cn << std::endl;
P_TEST_FULL( {}, {cv::ocl::matchTemplate(ocl_image, ocl_templ, dst, method);}, {});
P_TEST_FULL( {}, {cv::matchTemplate(image, templ, dst_gold, method);}, {});
}
#endif // PERF_TEST
} }
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, MatchTemplate8U, INSTANTIATE_TEST_CASE_P(GPU_ImgProc, MatchTemplate8U,