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

@@ -76,15 +76,14 @@ CUDA_TEST_P(FAST, Accuracy)
cv::Mat image = readImage("features2d/aloe.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(image.empty());
cv::cuda::FAST_CUDA fast(threshold);
fast.nonmaxSuppression = nonmaxSuppression;
cv::Ptr<cv::cuda::FastFeatureDetector> fast = cv::cuda::FastFeatureDetector::create(threshold, nonmaxSuppression);
if (!supportFeature(devInfo, cv::cuda::GLOBAL_ATOMICS))
{
try
{
std::vector<cv::KeyPoint> keypoints;
fast(loadMat(image), cv::cuda::GpuMat(), keypoints);
fast->detect(loadMat(image), keypoints);
}
catch (const cv::Exception& e)
{
@@ -94,7 +93,7 @@ CUDA_TEST_P(FAST, Accuracy)
else
{
std::vector<cv::KeyPoint> keypoints;
fast(loadMat(image), cv::cuda::GpuMat(), keypoints);
fast->detect(loadMat(image), keypoints);
std::vector<cv::KeyPoint> keypoints_gold;
cv::FAST(image, keypoints_gold, threshold, nonmaxSuppression);