fixed gpu performance sample (SURF usage)

added tests for filter2D
This commit is contained in:
Vladislav Vinogradov 2012-04-02 08:53:06 +00:00
parent 489a1da0ed
commit c02c676865

View File

@ -273,7 +273,7 @@ TEST(SURF)
SURF surf;
vector<KeyPoint> keypoints;
vector<float> descriptors;
Mat descriptors;
surf(src, Mat(), keypoints, descriptors);
@ -899,7 +899,6 @@ TEST(solvePnPRansac)
}
}
TEST(GaussianBlur)
{
for (int size = 1000; size <= 4000; size += 1000)
@ -928,6 +927,39 @@ TEST(GaussianBlur)
}
}
TEST(filter2D)
{
for (int size = 1000; size <= 4000; size += 1000)
{
Mat src;
gen(src, size, size, CV_8UC4, 0, 256);
for (int ksize = 3; ksize <= 16; ksize += 2)
{
SUBTEST << "ksize = " << ksize << ", " << size << 'x' << size << ", 8UC4";
Mat kernel;
gen(kernel, ksize, ksize, CV_32FC1, 0.0, 1.0);
Mat dst;
cv::filter2D(src, dst, -1, kernel);
CPU_ON;
cv::filter2D(src, dst, -1, kernel);
CPU_OFF;
gpu::GpuMat d_src(src);
gpu::GpuMat d_dst;
gpu::filter2D(d_src, d_dst, -1, kernel);
GPU_ON;
gpu::filter2D(d_src, d_dst, -1, kernel);
GPU_OFF;
}
}
}
TEST(pyrDown)
{
for (int size = 4000; size >= 1000; size -= 1000)