added test for gpu::Laplacian for CV_32FC1 type
changed epsilon for matrix comparison in gpu::sqrt test
This commit is contained in:
@@ -848,7 +848,7 @@ TEST_P(Sqrt, Accuracy)
|
|||||||
cv::Mat dst_gold;
|
cv::Mat dst_gold;
|
||||||
sqrtGold(src, dst_gold);
|
sqrtGold(src, dst_gold);
|
||||||
|
|
||||||
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
|
EXPECT_MAT_NEAR(dst_gold, dst, 1e-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GPU_Core, Sqrt, testing::Combine(
|
INSTANTIATE_TEST_CASE_P(GPU_Core, Sqrt, testing::Combine(
|
||||||
|
@@ -408,6 +408,21 @@ TEST_P(Laplacian, Color)
|
|||||||
EXPECT_MAT_NEAR(getInnerROI(dst_gold, cv::Size(3, 3)), getInnerROI(dst, cv::Size(3, 3)), 0.0);
|
EXPECT_MAT_NEAR(getInnerROI(dst_gold, cv::Size(3, 3)), getInnerROI(dst, cv::Size(3, 3)), 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(Laplacian, Gray_32FC1)
|
||||||
|
{
|
||||||
|
cv::Mat src;
|
||||||
|
cv::cvtColor(img, src, CV_BGR2GRAY);
|
||||||
|
src.convertTo(src, CV_32F, 1.0 / 255.0);
|
||||||
|
|
||||||
|
cv::gpu::GpuMat dst;
|
||||||
|
cv::gpu::Laplacian(loadMat(src, useRoi), dst, -1, ksize.width);
|
||||||
|
|
||||||
|
cv::Mat dst_gold;
|
||||||
|
cv::Laplacian(src, dst_gold, -1, ksize.width);
|
||||||
|
|
||||||
|
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
|
||||||
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(GPU_Filter, Laplacian, testing::Combine(
|
INSTANTIATE_TEST_CASE_P(GPU_Filter, Laplacian, testing::Combine(
|
||||||
ALL_DEVICES,
|
ALL_DEVICES,
|
||||||
testing::Values(KSize(1, 1), KSize(3, 3)),
|
testing::Values(KSize(1, 1), KSize(3, 3)),
|
||||||
|
Reference in New Issue
Block a user