refactor CUDA FAST feature detector algorithm:

use new FastFeatureDetector abstract interface and hidden implementation
This commit is contained in:
Vladislav Vinogradov
2015-01-12 18:11:09 +03:00
parent 6f91b7f6a4
commit 14ef62ed66
7 changed files with 213 additions and 216 deletions

View File

@@ -64,15 +64,18 @@ PERF_TEST_P(Image_Threshold_NonMaxSuppression, FAST,
if (PERF_RUN_CUDA())
{
cv::cuda::FAST_CUDA d_fast(threshold, nonMaxSuppersion, 0.5);
cv::Ptr<cv::cuda::FastFeatureDetector> d_fast =
cv::cuda::FastFeatureDetector::create(threshold, nonMaxSuppersion,
cv::FastFeatureDetector::TYPE_9_16,
0.5 * img.size().area());
const cv::cuda::GpuMat d_img(img);
cv::cuda::GpuMat d_keypoints;
TEST_CYCLE() d_fast(d_img, cv::cuda::GpuMat(), d_keypoints);
TEST_CYCLE() d_fast->detectAsync(d_img, d_keypoints);
std::vector<cv::KeyPoint> gpu_keypoints;
d_fast.downloadKeypoints(d_keypoints, gpu_keypoints);
d_fast->convert(d_keypoints, gpu_keypoints);
sortKeyPoints(gpu_keypoints);