1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

fixed build in gpu module (SURF and ORB)

This commit is contained in:
Vladislav Vinogradov
2012-03-18 12:05:49 +00:00
parent 46248851bf
commit 85c904a4ba
8 changed files with 100 additions and 110 deletions
+1
View File
@@ -61,6 +61,7 @@
#include "opencv2/ts/ts.hpp"
#include "opencv2/ts/ts_perf.hpp"
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "utility.hpp"
#include "interpolation.hpp"
+1 -1
View File
@@ -385,7 +385,7 @@ TEST_P(Sqrt, Array)
gpuRes.download(dst);
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
EXPECT_MAT_NEAR(dst_gold, dst, 1e-6);
}
INSTANTIATE_TEST_CASE_P(Arithm, Sqrt, Combine(
+8 -8
View File
@@ -96,16 +96,16 @@ struct SURF : TestWithParam<cv::gpu::DeviceInfo>
devInfo = GetParam();
cv::gpu::setDevice(devInfo.deviceID());
image = readImage("features2d/aloe.png", CV_LOAD_IMAGE_GRAYSCALE);
ASSERT_FALSE(image.empty());
ASSERT_FALSE(image.empty());
mask = cv::Mat(image.size(), CV_8UC1, cv::Scalar::all(1));
mask(cv::Range(0, image.rows / 2), cv::Range(0, image.cols / 2)).setTo(cv::Scalar::all(0));
cv::SURF fdetector_gold;
cv::SURF fdetector_gold;
fdetector_gold.extended = false;
fdetector_gold(image, mask, keypoints_gold, descriptors_gold);
fdetector_gold(image, mask, keypoints_gold, descriptors_gold);
}
};
@@ -135,7 +135,7 @@ TEST_P(SURF, Accuracy)
dev_descriptors.download(descriptors);
cv::BruteForceMatcher< cv::L2<float> > matcher;
cv::BFMatcher matcher(cv::NORM_L2);
std::vector<cv::DMatch> matches;
matcher.match(cv::Mat(static_cast<int>(keypoints_gold.size()), 64, CV_32FC1, &descriptors_gold[0]), descriptors, matches);
@@ -696,7 +696,7 @@ TEST_P(ORB, Accuracy)
d_descriptors.download(descriptors);
cv::BruteForceMatcher<cv::Hamming> matcher;
cv::BFMatcher matcher(cv::NORM_HAMMING);
std::vector<cv::DMatch> matches;
matcher.match(descriptors_gold, descriptors, matches);
+6
View File
@@ -334,6 +334,9 @@ PARAM_TEST_CASE(GaussianBlur, cv::gpu::DeviceInfo, cv::Size, UseRoi)
TEST_P(GaussianBlur, Rgba)
{
if (!devInfo.supports(cv::gpu::FEATURE_SET_COMPUTE_20) && ksize.height > 16)
return;
cv::Mat dst_rgba;
cv::gpu::GpuMat dev_dst_rgba;
@@ -347,6 +350,9 @@ TEST_P(GaussianBlur, Rgba)
TEST_P(GaussianBlur, Gray)
{
if (!devInfo.supports(cv::gpu::FEATURE_SET_COMPUTE_20) && ksize.height > 16)
return;
cv::Mat dst_gray;
cv::gpu::GpuMat dev_dst_gray;