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

added per-element min/max to gpu module.

fixed compile error in transform.
This commit is contained in:
Vladislav Vinogradov
2010-12-06 08:10:11 +00:00
parent d96c5ebb7d
commit 17d9014373
5 changed files with 319 additions and 3 deletions
+25
View File
@@ -949,6 +949,30 @@ struct CV_GpuCountNonZeroTest: CvTest
}
};
////////////////////////////////////////////////////////////////////////////////
// min/max
struct CV_GpuImageMinMaxTest : public CV_GpuArithmTest
{
CV_GpuImageMinMaxTest() : CV_GpuArithmTest( "GPU-ImageMinMax", "min/max" ) {}
int test( const Mat& mat1, const Mat& mat2 )
{
cv::Mat cpuMinRes, cpuMaxRes;
cv::min(mat1, mat2, cpuMinRes);
cv::max(mat1, mat2, cpuMaxRes);
GpuMat gpu1(mat1);
GpuMat gpu2(mat2);
GpuMat gpuMinRes, gpuMaxRes;
cv::gpu::min(gpu1, gpu2, gpuMinRes);
cv::gpu::max(gpu1, gpu2, gpuMaxRes);
return CheckNorm(cpuMinRes, gpuMinRes) == CvTS::OK && CheckNorm(cpuMaxRes, gpuMaxRes) == CvTS::OK ?
CvTS::OK : CvTS::FAIL_GENERIC;
}
};
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
@@ -979,3 +1003,4 @@ CV_GpuNppImagePolarToCartTest CV_GpuNppImagePolarToCart_test;
CV_GpuMinMaxTest CV_GpuMinMaxTest_test;
CV_GpuMinMaxLocTest CV_GpuMinMaxLocTest_test;
CV_GpuCountNonZeroTest CV_CountNonZero_test;
CV_GpuImageMinMaxTest CV_GpuImageMinMax_test;