fixed bug in gpu filter engine (incorrect buffer type) and in vector's saturate_cast.

changed buffer type in linear filters to float.
added support of 1 channel image to linear filters.
added support of BORDER_REFLECT101, BORDER_REPLICATE and BORDER_CONSTANT border type to gpu linear filters.
minor fix in tests.
update comments in gpu.hpp.
This commit is contained in:
Vladislav Vinogradov
2010-12-13 08:43:04 +00:00
parent 108ab94023
commit 49ec8ba742
9 changed files with 677 additions and 310 deletions

View File

@@ -107,7 +107,7 @@ protected:
if (!compareMatches(matchesCPU, matchesGPU))
{
ts->printf(CvTS::LOG, "Match FAIL");
ts->printf(CvTS::LOG, "Match FAIL\n");
ts->set_failed_test_info(CvTS::FAIL_MISMATCH);
return;
}
@@ -119,7 +119,7 @@ protected:
if (!compareMatches(knnMatchesCPU, knnMatchesGPU))
{
ts->printf(CvTS::LOG, "KNN Match FAIL");
ts->printf(CvTS::LOG, "KNN Match FAIL\n");
ts->set_failed_test_info(CvTS::FAIL_MISMATCH);
return;
}
@@ -131,7 +131,7 @@ protected:
if (!compareMatches(radiusMatchesCPU, radiusMatchesGPU))
{
ts->printf(CvTS::LOG, "Radius Match FAIL");
ts->printf(CvTS::LOG, "Radius Match FAIL\n");
ts->set_failed_test_info(CvTS::FAIL_MISMATCH);
return;
}

View File

@@ -80,7 +80,8 @@ protected:
double res = norm(m1ROI, m2ROI, NORM_INF);
if (res <= 1)
// Max difference (2.0) in GaussianBlur
if (res <= 2)
return CvTS::OK;
ts->printf(CvTS::LOG, "Norm: %f\n", res);
@@ -166,8 +167,6 @@ struct CV_GpuNppImageSobelTest : public CV_GpuNppFilterTest
int test(const Mat& img)
{
if (img.type() != CV_8UC1)
return CvTS::OK;
int ksizes[] = {3, 5, 7};
int ksizes_num = sizeof(ksizes) / sizeof(int);
@@ -183,10 +182,8 @@ struct CV_GpuNppImageSobelTest : public CV_GpuNppFilterTest
cv::Sobel(img, cpudst, -1, dx, dy, ksizes[i]);
GpuMat gpu1(img);
gpu1.convertTo(gpu1, CV_32S);
GpuMat gpudst;
cv::gpu::Sobel(gpu1, gpudst, -1, dx, dy, ksizes[i]);
gpudst.convertTo(gpudst, CV_8U);
if (CheckNorm(cpudst, gpudst, Size(ksizes[i], ksizes[i])) != CvTS::OK)
test_res = CvTS::FAIL_GENERIC;
@@ -204,20 +201,15 @@ struct CV_GpuNppImageScharrTest : public CV_GpuNppFilterTest
int test(const Mat& img)
{
if (img.type() != CV_8UC1)
return CvTS::OK;
int dx = 1, dy = 0;
Mat cpudst;
cv::Scharr(img, cpudst, -1, dx, dy);
GpuMat gpu1(img);
gpu1.convertTo(gpu1, CV_32S);
GpuMat gpudst;
cv::gpu::Scharr(gpu1, gpudst, -1, dx, dy);
gpudst.convertTo(gpudst, CV_8U);
return CheckNorm(cpudst, gpudst, Size(3, 3));
}
};
@@ -244,7 +236,7 @@ struct CV_GpuNppImageGaussianBlurTest : public CV_GpuNppFilterTest
{
cv::Size ksize(ksizes[i], ksizes[j]);
ts->printf(CvTS::LOG, "ksize = (%dx%d)\t", ksizes[i], ksizes[j]);
ts->printf(CvTS::LOG, "ksize = (%dx%d)\t\n", ksizes[i], ksizes[j]);
Mat cpudst;
cv::GaussianBlur(img, cpudst, ksize, sigma1);