|
|
|
@ -43,16 +43,14 @@ |
|
|
|
|
#ifdef HAVE_OPENCL |
|
|
|
|
namespace |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// BruteForceMatcher
|
|
|
|
|
|
|
|
|
|
CV_ENUM(DistType, cv::ocl::BruteForceMatcher_OCL_base::L1Dist, cv::ocl::BruteForceMatcher_OCL_base::L2Dist, cv::ocl::BruteForceMatcher_OCL_base::HammingDist) |
|
|
|
|
CV_ENUM(DistType, cv::ocl::BruteForceMatcher_OCL_base::L1Dist,\
|
|
|
|
|
cv::ocl::BruteForceMatcher_OCL_base::L2Dist,\
|
|
|
|
|
cv::ocl::BruteForceMatcher_OCL_base::HammingDist) |
|
|
|
|
IMPLEMENT_PARAM_CLASS(DescriptorSize, int) |
|
|
|
|
|
|
|
|
|
PARAM_TEST_CASE(BruteForceMatcher/*, NormCode*/, DistType, DescriptorSize) |
|
|
|
|
PARAM_TEST_CASE(BruteForceMatcher, DistType, DescriptorSize) |
|
|
|
|
{ |
|
|
|
|
//std::vector<cv::ocl::Info> oclinfo;
|
|
|
|
|
cv::ocl::BruteForceMatcher_OCL_base::DistType distType; |
|
|
|
|
int normCode; |
|
|
|
|
int dim; |
|
|
|
@ -64,13 +62,9 @@ namespace |
|
|
|
|
|
|
|
|
|
virtual void SetUp() |
|
|
|
|
{ |
|
|
|
|
//normCode = GET_PARAM(0);
|
|
|
|
|
distType = (cv::ocl::BruteForceMatcher_OCL_base::DistType)(int)GET_PARAM(0); |
|
|
|
|
dim = GET_PARAM(1); |
|
|
|
|
|
|
|
|
|
//int devnums = getDevice(oclinfo, OPENCV_DEFAULT_OPENCL_DEVICE);
|
|
|
|
|
//CV_Assert(devnums > 0);
|
|
|
|
|
|
|
|
|
|
queryDescCount = 300; // must be even number because we split train data in some cases in two
|
|
|
|
|
countFactor = 4; // do not change it
|
|
|
|
|
|
|
|
|
@ -172,21 +166,6 @@ namespace |
|
|
|
|
|
|
|
|
|
cv::ocl::BruteForceMatcher_OCL_base matcher(distType); |
|
|
|
|
|
|
|
|
|
// assume support atomic.
|
|
|
|
|
//if (!supportFeature(devInfo, cv::gpu::GLOBAL_ATOMICS))
|
|
|
|
|
//{
|
|
|
|
|
// try
|
|
|
|
|
// {
|
|
|
|
|
// std::vector< std::vector<cv::DMatch> > matches;
|
|
|
|
|
// matcher.radiusMatch(loadMat(query), loadMat(train), matches, radius);
|
|
|
|
|
// }
|
|
|
|
|
// catch (const cv::Exception& e)
|
|
|
|
|
// {
|
|
|
|
|
// ASSERT_EQ(CV_StsNotImplemented, e.code);
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//else
|
|
|
|
|
{ |
|
|
|
|
std::vector< std::vector<cv::DMatch> > matches; |
|
|
|
|
matcher.radiusMatch(cv::ocl::oclMat(query), cv::ocl::oclMat(train), matches, radius); |
|
|
|
|
|
|
|
|
@ -209,10 +188,9 @@ namespace |
|
|
|
|
|
|
|
|
|
ASSERT_EQ(0, badCount); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
INSTANTIATE_TEST_CASE_P(GPU_Features2D, BruteForceMatcher, testing::Combine( |
|
|
|
|
//ALL_DEVICES,
|
|
|
|
|
INSTANTIATE_TEST_CASE_P(OCL_Features2D, BruteForceMatcher,
|
|
|
|
|
testing::Combine( |
|
|
|
|
testing::Values(DistType(cv::ocl::BruteForceMatcher_OCL_base::L1Dist), DistType(cv::ocl::BruteForceMatcher_OCL_base::L2Dist)), |
|
|
|
|
testing::Values(DescriptorSize(57), DescriptorSize(64), DescriptorSize(83), DescriptorSize(128), DescriptorSize(179), DescriptorSize(256), DescriptorSize(304)))); |
|
|
|
|
|
|
|
|
|