Implementation detector and selector for IPP and OpenCL;

IPP can be switched on and off on runtime;

Optional implementation collector was added (switched off by default in CMake). Gathers data of implementation used in functions and report this info through performance TS;

TS modifications for implementations control;
This commit is contained in:
Pavel Vlasov
2014-10-03 15:17:28 +04:00
parent 83ef276697
commit 45958eaabc
49 changed files with 4279 additions and 2799 deletions
+4 -1
View File
@@ -332,7 +332,10 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
{
if( ocl::useOpenCL() && _img.isUMat() && type == FastFeatureDetector::TYPE_9_16 &&
ocl_FAST(_img, keypoints, threshold, nonmax_suppression, 10000))
return;
{
CV_IMPL_ADD(CV_IMPL_OCL);
return;
}
switch(type) {
case FastFeatureDetector::TYPE_5_8:
+18
View File
@@ -943,12 +943,18 @@ void BFMatcher::knnMatchImpl( InputArray _queryDescriptors, std::vector<std::vec
if(trainDescCollection.empty())
{
if(ocl_match(_queryDescriptors, utrainDescCollection[0], matches, normType))
{
CV_IMPL_ADD(CV_IMPL_OCL);
return;
}
}
else
{
if(ocl_match(_queryDescriptors, trainDescCollection[0], matches, normType))
{
CV_IMPL_ADD(CV_IMPL_OCL);
return;
}
}
}
else
@@ -956,12 +962,18 @@ void BFMatcher::knnMatchImpl( InputArray _queryDescriptors, std::vector<std::vec
if(trainDescCollection.empty())
{
if(ocl_knnMatch(_queryDescriptors, utrainDescCollection[0], matches, knn, normType, compactResult) )
{
CV_IMPL_ADD(CV_IMPL_OCL);
return;
}
}
else
{
if(ocl_knnMatch(_queryDescriptors, trainDescCollection[0], matches, knn, normType, compactResult) )
{
CV_IMPL_ADD(CV_IMPL_OCL);
return;
}
}
}
}
@@ -1073,12 +1085,18 @@ void BFMatcher::radiusMatchImpl( InputArray _queryDescriptors, std::vector<std::
if (trainDescCollection.empty())
{
if(ocl_radiusMatch(_queryDescriptors, utrainDescCollection[0], matches, maxDistance, normType, compactResult) )
{
CV_IMPL_ADD(CV_IMPL_OCL);
return;
}
}
else
{
if (ocl_radiusMatch(_queryDescriptors, trainDescCollection[0], matches, maxDistance, normType, compactResult) )
{
CV_IMPL_ADD(CV_IMPL_OCL);
return;
}
}
}
+6
View File
@@ -823,6 +823,7 @@ static void computeKeyPoints(const Mat& imagePyramid,
uresponses, nkeypoints, 7, HARRIS_K );
if( useOCL )
{
CV_IMPL_ADD(CV_IMPL_OCL);
uresponses.copyTo(responses);
for( i = 0; i < nkeypoints; i++ )
allKeypoints[i].response = responses.at<float>(i);
@@ -867,6 +868,7 @@ static void computeKeyPoints(const Mat& imagePyramid,
if( useOCL )
{
CV_IMPL_ADD(CV_IMPL_OCL);
uresponses.copyTo(responses);
for( i = 0; i < nkeypoints; i++ )
allKeypoints[i].angle = responses.at<float>(i);
@@ -1110,6 +1112,10 @@ void ORB::operator()( InputArray _image, InputArray _mask, std::vector<KeyPoint>
useOCL = ocl_computeOrbDescriptors(uimagePyramid, ulayerInfo,
ukeypoints, udescriptors, upattern,
nkeypoints, dsize, WTA_K);
if(useOCL)
{
CV_IMPL_ADD(CV_IMPL_OCL);
}
}
if( !useOCL )