Revert "call resetDevice if gpu test fails"

This reverts commit ab25fe9e37.
This commit is contained in:
Vladislav Vinogradov 2012-12-19 11:13:31 +04:00
parent 41c9377db0
commit 4ba33fa1ed
36 changed files with 5694 additions and 9450 deletions

View File

@ -91,8 +91,6 @@ PERF_TEST_P(Image, HoughLinesP,
cv::Mat image = cv::imread(fileName, cv::IMREAD_GRAYSCALE);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_image(image);
cv::gpu::GpuMat d_lines;
@ -105,12 +103,6 @@ PERF_TEST_P(Image, HoughLinesP,
cv::gpu::HoughLinesP(d_image, d_lines, d_buf, rho, theta, minLineLenght, maxLineGap);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat mask;
@ -162,8 +154,6 @@ PERF_TEST_P(Image_Depth, GoodFeaturesToTrack,
mask(cv::Rect(0, 0, 100, 100)).setTo(cv::Scalar::all(0));
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GoodFeaturesToTrackDetector_GPU d_detector(maxCorners, qualityLevel, minDistance, blockSize, useHarrisDetector, k);
@ -178,12 +168,6 @@ PERF_TEST_P(Image_Depth, GoodFeaturesToTrack,
d_detector(d_src, d_pts, d_mask);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
if (depth != CV_8U)
@ -259,8 +243,6 @@ PERF_TEST_P(ImagePair_Depth_GraySource, OpticalFlowPyrLKSparse,
}
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src1(src1);
cv::gpu::GpuMat d_src2(src2);
@ -281,12 +263,6 @@ PERF_TEST_P(ImagePair_Depth_GraySource, OpticalFlowPyrLKSparse,
d_pyrLK.sparse(d_src1, d_src2, d_pts, d_nextPts, d_status);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
if (depth != CV_8U)
@ -345,8 +321,6 @@ PERF_TEST_P(ImagePair_Depth, OpticalFlowFarneback,
}
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src1(src1);
cv::gpu::GpuMat d_src2(src2);
@ -369,12 +343,6 @@ PERF_TEST_P(ImagePair_Depth, OpticalFlowFarneback,
d_farneback(d_src1, d_src2, d_u, d_v);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
if (depth != CV_8U)
@ -440,8 +408,6 @@ PERF_TEST_P(ImagePair_BlockSize_ShiftSize_MaxRange, OpticalFlowBM,
FAIL() << "Unable to load source image [" << fileNames.second << "]";
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src1(src1);
cv::gpu::GpuMat d_src2(src2);
@ -454,12 +420,6 @@ PERF_TEST_P(ImagePair_BlockSize_ShiftSize_MaxRange, OpticalFlowBM,
cv::gpu::calcOpticalFlowBM(d_src1, d_src2, block_size, shift_size, max_range, false, d_velx, d_vely, buf);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat velx, vely;
@ -499,8 +459,6 @@ PERF_TEST_P(ImagePair_BlockSize_ShiftSize_MaxRange, FastOpticalFlowBM,
FAIL() << "Unable to load source image [" << fileNames.second << "]";
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src1(src1);
cv::gpu::GpuMat d_src2(src2);
@ -515,12 +473,6 @@ PERF_TEST_P(ImagePair_BlockSize_ShiftSize_MaxRange, FastOpticalFlowBM,
fastBM(d_src1, d_src2, d_velx, d_vely, max_range.width, block_size.width);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat velx, vely;

View File

@ -25,8 +25,6 @@ PERF_TEST_P(ImagePair, Calib3D_StereoBM, Values(pair_string("gpu/perf/aloe.png",
const int ndisp = 256;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::StereoBM_GPU d_bm(preset, ndisp);
@ -43,12 +41,6 @@ PERF_TEST_P(ImagePair, Calib3D_StereoBM, Values(pair_string("gpu/perf/aloe.png",
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::StereoBM bm(preset, ndisp);
@ -82,8 +74,6 @@ PERF_TEST_P(ImagePair, Calib3D_StereoBeliefPropagation, Values(pair_string("gpu/
const int ndisp = 64;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::StereoBeliefPropagation d_bp(ndisp);
@ -100,12 +90,6 @@ PERF_TEST_P(ImagePair, Calib3D_StereoBeliefPropagation, Values(pair_string("gpu/
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy.";
@ -128,8 +112,6 @@ PERF_TEST_P(ImagePair, Calib3D_StereoConstantSpaceBP, Values(pair_string("gpu/st
const int ndisp = 128;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::StereoConstantSpaceBP d_csbp(ndisp);
@ -146,12 +128,6 @@ PERF_TEST_P(ImagePair, Calib3D_StereoConstantSpaceBP, Values(pair_string("gpu/st
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy.";
@ -172,8 +148,6 @@ PERF_TEST_P(ImagePair, Calib3D_DisparityBilateralFilter, Values(pair_string("gpu
const int ndisp = 128;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::DisparityBilateralFilter d_filter(ndisp);
@ -190,12 +164,6 @@ PERF_TEST_P(ImagePair, Calib3D_DisparityBilateralFilter, Values(pair_string("gpu
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy.";
@ -218,8 +186,6 @@ PERF_TEST_P(Count, Calib3D_TransformPoints, Values(5000, 10000, 20000))
const cv::Mat tvec = cv::Mat::ones(1, 3, CV_32FC1);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -233,12 +199,6 @@ PERF_TEST_P(Count, Calib3D_TransformPoints, Values(5000, 10000, 20000))
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy.";
@ -260,8 +220,6 @@ PERF_TEST_P(Count, Calib3D_ProjectPoints, Values(5000, 10000, 20000))
const cv::Mat camera_mat = cv::Mat::ones(3, 3, CV_32FC1);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -275,12 +233,6 @@ PERF_TEST_P(Count, Calib3D_ProjectPoints, Values(5000, 10000, 20000))
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -330,8 +282,6 @@ PERF_TEST_P(Count, Calib3D_SolvePnPRansac, Values(5000, 10000, 20000))
cv::Mat tvec;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::solvePnPRansac(object, image, camera_mat, dist_coef, rvec, tvec);
@ -340,12 +290,6 @@ PERF_TEST_P(Count, Calib3D_SolvePnPRansac, Values(5000, 10000, 20000))
cv::gpu::solvePnPRansac(object, image, camera_mat, dist_coef, rvec, tvec);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::solvePnPRansac(object, image, camera_mat, dist_coef, rvec, tvec);
@ -375,8 +319,6 @@ PERF_TEST_P(Sz_Depth, Calib3D_ReprojectImageTo3D, Combine(GPU_TYPICAL_MAT_SIZES,
fillRandom(Q, 0.1, 1.0);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -390,12 +332,6 @@ PERF_TEST_P(Sz_Depth, Calib3D_ReprojectImageTo3D, Combine(GPU_TYPICAL_MAT_SIZES,
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -423,8 +359,6 @@ PERF_TEST_P(Sz_Depth, Calib3D_DrawColorDisp, Combine(GPU_TYPICAL_MAT_SIZES, Valu
fillRandom(src, 0, 255);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -438,12 +372,6 @@ PERF_TEST_P(Sz_Depth, Calib3D_DrawColorDisp, Combine(GPU_TYPICAL_MAT_SIZES, Valu
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy.";

File diff suppressed because it is too large Load Diff

View File

@ -31,8 +31,6 @@ PERF_TEST_P(Sz_Depth_Cn_KernelSz, Denoising_BilateralFilter,
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -46,12 +44,6 @@ PERF_TEST_P(Sz_Depth_Cn_KernelSz, Denoising_BilateralFilter,
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -94,8 +86,6 @@ PERF_TEST_P(Sz_Depth_Cn_WinSz_BlockSz, Denoising_NonLocalMeans,
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -109,12 +99,6 @@ PERF_TEST_P(Sz_Depth_Cn_WinSz_BlockSz, Denoising_NonLocalMeans,
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -145,8 +129,6 @@ PERF_TEST_P(Sz_Depth_Cn_WinSz_BlockSz, Denoising_FastNonLocalMeans,
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -161,12 +143,6 @@ PERF_TEST_P(Sz_Depth_Cn_WinSz_BlockSz, Denoising_FastNonLocalMeans,
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -204,8 +180,6 @@ PERF_TEST_P(Sz_Depth_WinSz_BlockSz, Denoising_FastNonLocalMeansColored,
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -220,12 +194,6 @@ PERF_TEST_P(Sz_Depth_WinSz_BlockSz, Denoising_FastNonLocalMeansColored,
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;

View File

@ -18,8 +18,6 @@ PERF_TEST_P(Image, Features2D_SURF, Values<string>("gpu/perf/aloe.png"))
ASSERT_FALSE(img.empty());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::SURF_GPU d_surf;
@ -36,12 +34,6 @@ PERF_TEST_P(Image, Features2D_SURF, Values<string>("gpu/perf/aloe.png"))
GPU_SANITY_CHECK(d_descriptors, 1e-4);
GPU_SANITY_CHECK_KEYPOINTS(SURF, d_keypoints);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::SURF surf;
@ -71,8 +63,6 @@ PERF_TEST_P(Image, Features2D_FAST, Values<string>("gpu/perf/aloe.png"))
ASSERT_FALSE(img.empty());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::FAST_GPU d_fast(20);
@ -88,12 +78,6 @@ PERF_TEST_P(Image, Features2D_FAST, Values<string>("gpu/perf/aloe.png"))
GPU_SANITY_CHECK_RESPONSE(FAST, d_keypoints);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
std::vector<cv::KeyPoint> keypoints;
@ -119,8 +103,6 @@ PERF_TEST_P(Image, Features2D_ORB, Values<string>("gpu/perf/aloe.png"))
ASSERT_FALSE(img.empty());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::ORB_GPU d_orb(4000);
@ -137,12 +119,6 @@ PERF_TEST_P(Image, Features2D_ORB, Values<string>("gpu/perf/aloe.png"))
GPU_SANITY_CHECK_KEYPOINTS(ORB, d_keypoints);
GPU_SANITY_CHECK(d_descriptors);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::ORB orb(4000);
@ -184,8 +160,6 @@ PERF_TEST_P(DescSize_Norm, Features2D_BFMatch, Combine(Values(64, 128, 256), Val
fillRandom(train);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::BFMatcher_GPU d_matcher(normType);
@ -203,12 +177,6 @@ PERF_TEST_P(DescSize_Norm, Features2D_BFMatch, Combine(Values(64, 128, 256), Val
GPU_SANITY_CHECK(d_trainIdx);
GPU_SANITY_CHECK(d_distance);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::BFMatcher matcher(normType);
@ -251,8 +219,6 @@ PERF_TEST_P(DescSize_K_Norm, Features2D_BFKnnMatch, Combine(
fillRandom(train);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::BFMatcher_GPU d_matcher(normType);
@ -270,12 +236,6 @@ PERF_TEST_P(DescSize_K_Norm, Features2D_BFKnnMatch, Combine(
GPU_SANITY_CHECK(d_trainIdx);
GPU_SANITY_CHECK(d_distance);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::BFMatcher matcher(normType);
@ -312,8 +272,6 @@ PERF_TEST_P(DescSize_Norm, Features2D_BFRadiusMatch, Combine(Values(64, 128, 256
fillRandom(train, 0.0, 1.0);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::BFMatcher_GPU d_matcher(normType);
@ -331,12 +289,6 @@ PERF_TEST_P(DescSize_Norm, Features2D_BFRadiusMatch, Combine(Values(64, 128, 256
GPU_SANITY_CHECK(d_trainIdx);
GPU_SANITY_CHECK(d_distance);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::BFMatcher matcher(normType);

View File

@ -22,8 +22,6 @@ PERF_TEST_P(Sz_Type_KernelSz, Filters_Blur, Combine(GPU_TYPICAL_MAT_SIZES, Value
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -37,12 +35,6 @@ PERF_TEST_P(Sz_Type_KernelSz, Filters_Blur, Combine(GPU_TYPICAL_MAT_SIZES, Value
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -73,8 +65,6 @@ PERF_TEST_P(Sz_Type_KernelSz, Filters_Sobel, Combine(GPU_TYPICAL_MAT_SIZES, Valu
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -89,12 +79,6 @@ PERF_TEST_P(Sz_Type_KernelSz, Filters_Sobel, Combine(GPU_TYPICAL_MAT_SIZES, Valu
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -124,8 +108,6 @@ PERF_TEST_P(Sz_Type, Filters_Scharr, Combine(GPU_TYPICAL_MAT_SIZES, Values(CV_8U
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -140,12 +122,6 @@ PERF_TEST_P(Sz_Type, Filters_Scharr, Combine(GPU_TYPICAL_MAT_SIZES, Values(CV_8U
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -176,8 +152,6 @@ PERF_TEST_P(Sz_Type_KernelSz, Filters_GaussianBlur, Combine(GPU_TYPICAL_MAT_SIZE
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -192,12 +166,6 @@ PERF_TEST_P(Sz_Type_KernelSz, Filters_GaussianBlur, Combine(GPU_TYPICAL_MAT_SIZE
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -228,8 +196,6 @@ PERF_TEST_P(Sz_Type_KernelSz, Filters_Laplacian, Combine(GPU_TYPICAL_MAT_SIZES,
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -243,12 +209,6 @@ PERF_TEST_P(Sz_Type_KernelSz, Filters_Laplacian, Combine(GPU_TYPICAL_MAT_SIZES,
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -280,8 +240,6 @@ PERF_TEST_P(Sz_Type, Filters_Erode, Combine(GPU_TYPICAL_MAT_SIZES, Values(CV_8UC
cv::Mat ker = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(3, 3));
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -296,12 +254,6 @@ PERF_TEST_P(Sz_Type, Filters_Erode, Combine(GPU_TYPICAL_MAT_SIZES, Values(CV_8UC
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -333,8 +285,6 @@ PERF_TEST_P(Sz_Type, Filters_Dilate, Combine(GPU_TYPICAL_MAT_SIZES, Values(CV_8U
cv::Mat ker = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(3, 3));
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -349,12 +299,6 @@ PERF_TEST_P(Sz_Type, Filters_Dilate, Combine(GPU_TYPICAL_MAT_SIZES, Values(CV_8U
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -392,8 +336,6 @@ PERF_TEST_P(Sz_Type_Op, Filters_MorphologyEx, Combine(GPU_TYPICAL_MAT_SIZES, Val
cv::Mat ker = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(3, 3));
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -409,12 +351,6 @@ PERF_TEST_P(Sz_Type_Op, Filters_MorphologyEx, Combine(GPU_TYPICAL_MAT_SIZES, Val
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -448,8 +384,6 @@ PERF_TEST_P(Sz_Type_KernelSz, Filters_Filter2D, Combine(GPU_TYPICAL_MAT_SIZES, V
fillRandom(kernel, 0.0, 1.0);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -463,12 +397,6 @@ PERF_TEST_P(Sz_Type_KernelSz, Filters_Filter2D, Combine(GPU_TYPICAL_MAT_SIZES, V
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;

View File

@ -79,8 +79,6 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border_Mode, ImgProc_Remap, Combine(
generateMap(xmap, ymap, remapMode);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_xmap(xmap);
@ -96,12 +94,6 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border_Mode, ImgProc_Remap, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -141,8 +133,6 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, ImgProc_Resize, Combine(
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -156,12 +146,6 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, ImgProc_Resize, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -200,8 +184,6 @@ PERF_TEST_P(Sz_Depth_Cn_Scale, ImgProc_ResizeArea, Combine(
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -215,12 +197,6 @@ PERF_TEST_P(Sz_Depth_Cn_Scale, ImgProc_ResizeArea, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -265,8 +241,6 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, ImgProc_WarpAffine, Combine(
cv::Mat M(2, 3, CV_64F, (void*) mat);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -280,12 +254,6 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, ImgProc_WarpAffine, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -329,8 +297,6 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, ImgProc_WarpPerspective, Combine(
cv::Mat M(3, 3, CV_64F, (void*) mat);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -344,12 +310,6 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, ImgProc_WarpPerspective, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -385,8 +345,6 @@ PERF_TEST_P(Sz_Depth_Cn_Border, ImgProc_CopyMakeBorder, Combine(
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -400,12 +358,6 @@ PERF_TEST_P(Sz_Depth_Cn_Border, ImgProc_CopyMakeBorder, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -440,8 +392,6 @@ PERF_TEST_P(Sz_Depth_Op, ImgProc_Threshold, Combine(
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -455,12 +405,6 @@ PERF_TEST_P(Sz_Depth_Op, ImgProc_Threshold, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -485,8 +429,6 @@ PERF_TEST_P(Sz, ImgProc_Integral, GPU_TYPICAL_MAT_SIZES)
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -501,12 +443,6 @@ PERF_TEST_P(Sz, ImgProc_Integral, GPU_TYPICAL_MAT_SIZES)
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -531,8 +467,6 @@ PERF_TEST_P(Sz, ImgProc_IntegralSqr, GPU_TYPICAL_MAT_SIZES)
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -546,12 +480,6 @@ PERF_TEST_P(Sz, ImgProc_IntegralSqr, GPU_TYPICAL_MAT_SIZES)
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -570,8 +498,6 @@ PERF_TEST_P(Sz_Depth, ImgProc_HistEvenC1, Combine(GPU_TYPICAL_MAT_SIZES, Values(
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_hist;
@ -586,12 +512,6 @@ PERF_TEST_P(Sz_Depth, ImgProc_HistEvenC1, Combine(GPU_TYPICAL_MAT_SIZES, Values(
GPU_SANITY_CHECK(d_hist);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
int hbins = 30;
@ -627,8 +547,6 @@ PERF_TEST_P(Sz_Depth, ImgProc_HistEvenC4, Combine(GPU_TYPICAL_MAT_SIZES, Values(
int upperLevel[] = {180, 180, 180, 180};
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_hist[4];
@ -643,12 +561,6 @@ PERF_TEST_P(Sz_Depth, ImgProc_HistEvenC4, Combine(GPU_TYPICAL_MAT_SIZES, Values(
GPU_SANITY_CHECK(d_hist0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -666,8 +578,6 @@ PERF_TEST_P(Sz, ImgProc_CalcHist, GPU_TYPICAL_MAT_SIZES)
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_hist;
@ -681,12 +591,6 @@ PERF_TEST_P(Sz, ImgProc_CalcHist, GPU_TYPICAL_MAT_SIZES)
GPU_SANITY_CHECK(d_hist);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -704,8 +608,6 @@ PERF_TEST_P(Sz, ImgProc_EqualizeHist, GPU_TYPICAL_MAT_SIZES)
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -721,12 +623,6 @@ PERF_TEST_P(Sz, ImgProc_EqualizeHist, GPU_TYPICAL_MAT_SIZES)
GPU_SANITY_CHECK(d_hist);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -751,8 +647,6 @@ PERF_TEST_P(Sz, ImgProc_ColumnSum, GPU_TYPICAL_MAT_SIZES)
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -766,12 +660,6 @@ PERF_TEST_P(Sz, ImgProc_ColumnSum, GPU_TYPICAL_MAT_SIZES)
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -796,8 +684,6 @@ PERF_TEST_P(Image_AppertureSz_L2gradient, ImgProc_Canny, Combine(
ASSERT_FALSE(image.empty());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_image(image);
cv::gpu::GpuMat d_dst;
@ -812,12 +698,6 @@ PERF_TEST_P(Image_AppertureSz_L2gradient, ImgProc_Canny, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -847,8 +727,6 @@ PERF_TEST_P(Image, ImgProc_MeanShiftFiltering, Values<string>("gpu/meanshift/con
cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(rgba);
cv::gpu::GpuMat d_dst;
@ -862,12 +740,6 @@ PERF_TEST_P(Image, ImgProc_MeanShiftFiltering, Values<string>("gpu/meanshift/con
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -895,8 +767,6 @@ PERF_TEST_P(Image, ImgProc_MeanShiftProc, Values<string>("gpu/meanshift/cones.pn
cv::cvtColor(img, rgba, cv::COLOR_BGR2BGRA);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(rgba);
cv::gpu::GpuMat d_dstr;
@ -911,12 +781,6 @@ PERF_TEST_P(Image, ImgProc_MeanShiftProc, Values<string>("gpu/meanshift/cones.pn
GPU_SANITY_CHECK(d_dstr);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -939,8 +803,6 @@ PERF_TEST_P(Image, ImgProc_MeanShiftSegmentation, Values<string>("gpu/meanshift/
cv::Mat dst;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(rgba);
@ -953,12 +815,6 @@ PERF_TEST_P(Image, ImgProc_MeanShiftSegmentation, Values<string>("gpu/meanshift/
GPU_SANITY_CHECK(dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -983,8 +839,6 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_BlendLinear, Combine(GPU_TYPICAL_MAT_SIZES, Val
fillRandom(img2);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_img1(img1);
cv::gpu::GpuMat d_img2(img2);
@ -1001,12 +855,6 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_BlendLinear, Combine(GPU_TYPICAL_MAT_SIZES, Val
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -1033,8 +881,6 @@ PERF_TEST_P(Sz_KernelSz_Ccorr, ImgProc_Convolve, Combine(GPU_TYPICAL_MAT_SIZES,
templ.setTo(1.0);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_image = cv::gpu::createContinuous(size, CV_32FC1);
d_image.upload(image);
@ -1054,12 +900,6 @@ PERF_TEST_P(Sz_KernelSz_Ccorr, ImgProc_Convolve, Combine(GPU_TYPICAL_MAT_SIZES,
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
ASSERT_FALSE(ccorr);
@ -1103,8 +943,6 @@ PERF_TEST_P(Sz_TemplateSz_Cn_Method, ImgProc_MatchTemplate8U, Combine(
fillRandom(templ);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_image(image);
cv::gpu::GpuMat d_templ(templ);
@ -1119,12 +957,6 @@ PERF_TEST_P(Sz_TemplateSz_Cn_Method, ImgProc_MatchTemplate8U, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -1161,8 +993,6 @@ PERF_TEST_P(Sz_TemplateSz_Cn_Method, ImgProc_MatchTemplate32F, Combine(
fillRandom(templ);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_image(image);
cv::gpu::GpuMat d_templ(templ);
@ -1177,12 +1007,6 @@ PERF_TEST_P(Sz_TemplateSz_Cn_Method, ImgProc_MatchTemplate32F, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -1219,8 +1043,6 @@ PERF_TEST_P(Sz_Flags, ImgProc_MulSpectrums, Combine(
fillRandom(b, 0, 100);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_a(a);
cv::gpu::GpuMat d_b(b);
@ -1235,12 +1057,6 @@ PERF_TEST_P(Sz_Flags, ImgProc_MulSpectrums, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -1272,8 +1088,6 @@ PERF_TEST_P(Sz, ImgProc_MulAndScaleSpectrums, GPU_TYPICAL_MAT_SIZES)
fillRandom(src2, 0, 100);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src1(src1);
cv::gpu::GpuMat d_src2(src2);
@ -1288,12 +1102,6 @@ PERF_TEST_P(Sz, ImgProc_MulAndScaleSpectrums, GPU_TYPICAL_MAT_SIZES)
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -1316,8 +1124,6 @@ PERF_TEST_P(Sz_Flags, ImgProc_Dft, Combine(
fillRandom(src, 0, 100);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -1331,12 +1137,6 @@ PERF_TEST_P(Sz_Flags, ImgProc_Dft, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -1377,8 +1177,6 @@ PERF_TEST_P(Image_Type_Border_BlockSz_ApertureSz, ImgProc_CornerHarris, Combine(
double k = 0.5;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_img(img);
cv::gpu::GpuMat d_dst;
@ -1395,12 +1193,6 @@ PERF_TEST_P(Image_Type_Border_BlockSz_ApertureSz, ImgProc_CornerHarris, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -1438,8 +1230,6 @@ PERF_TEST_P(Image_Type_Border_BlockSz_ApertureSz, ImgProc_CornerMinEigenVal, Com
img.convertTo(img, type, type == CV_32F ? 1.0 / 255.0 : 1.0);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_img(img);
cv::gpu::GpuMat d_dst;
@ -1456,12 +1246,6 @@ PERF_TEST_P(Image_Type_Border_BlockSz_ApertureSz, ImgProc_CornerMinEigenVal, Com
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -1489,8 +1273,6 @@ PERF_TEST_P(Sz, ImgProc_BuildWarpPlaneMaps, GPU_TYPICAL_MAT_SIZES)
cv::Mat T = cv::Mat::zeros(1, 3, CV_32F);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_map_x;
cv::gpu::GpuMat d_map_y;
@ -1505,12 +1287,6 @@ PERF_TEST_P(Sz, ImgProc_BuildWarpPlaneMaps, GPU_TYPICAL_MAT_SIZES)
GPU_SANITY_CHECK(d_map_x);
GPU_SANITY_CHECK(d_map_y);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -1528,8 +1304,6 @@ PERF_TEST_P(Sz, ImgProc_BuildWarpCylindricalMaps, GPU_TYPICAL_MAT_SIZES)
cv::Mat R = cv::Mat::ones(3, 3, CV_32FC1);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_map_x;
cv::gpu::GpuMat d_map_y;
@ -1544,12 +1318,6 @@ PERF_TEST_P(Sz, ImgProc_BuildWarpCylindricalMaps, GPU_TYPICAL_MAT_SIZES)
GPU_SANITY_CHECK(d_map_x);
GPU_SANITY_CHECK(d_map_y);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -1567,8 +1335,6 @@ PERF_TEST_P(Sz, ImgProc_BuildWarpSphericalMaps, GPU_TYPICAL_MAT_SIZES)
cv::Mat R = cv::Mat::ones(3, 3, CV_32FC1);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_map_x;
cv::gpu::GpuMat d_map_y;
@ -1582,12 +1348,7 @@ PERF_TEST_P(Sz, ImgProc_BuildWarpSphericalMaps, GPU_TYPICAL_MAT_SIZES)
GPU_SANITY_CHECK(d_map_x);
GPU_SANITY_CHECK(d_map_y);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
@ -1617,8 +1378,6 @@ PERF_TEST_P(Sz_Depth_Cn_Inter, ImgProc_Rotate, Combine(
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -1632,12 +1391,6 @@ PERF_TEST_P(Sz_Depth_Cn_Inter, ImgProc_Rotate, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -1662,8 +1415,6 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_PyrDown, Combine(
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -1677,12 +1428,6 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_PyrDown, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -1716,8 +1461,6 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_PyrUp, Combine(
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -1731,12 +1474,6 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_PyrUp, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -1795,8 +1532,6 @@ PERF_TEST_P(Sz_Depth_Code, ImgProc_CvtColor, Combine(
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -1810,12 +1545,6 @@ PERF_TEST_P(Sz_Depth_Code, ImgProc_CvtColor, Combine(
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -1844,8 +1573,6 @@ PERF_TEST_P(Sz, ImgProc_SwapChannels, GPU_TYPICAL_MAT_SIZES)
const int dstOrder[] = {2, 1, 0, 3};
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
@ -1858,12 +1585,6 @@ PERF_TEST_P(Sz, ImgProc_SwapChannels, GPU_TYPICAL_MAT_SIZES)
GPU_SANITY_CHECK(d_src);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -1891,8 +1612,6 @@ PERF_TEST_P(Sz_Type_Op, ImgProc_AlphaComp, Combine(GPU_TYPICAL_MAT_SIZES, Values
fillRandom(img2);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_img1(img1);
cv::gpu::GpuMat d_img2(img2);
@ -1907,12 +1626,6 @@ PERF_TEST_P(Sz_Type_Op, ImgProc_AlphaComp, Combine(GPU_TYPICAL_MAT_SIZES, Values
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -1934,8 +1647,6 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_ImagePyramidBuild, Combine(GPU_TYPICAL_MAT_SIZE
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
@ -1950,12 +1661,6 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_ImagePyramidBuild, Combine(GPU_TYPICAL_MAT_SIZE
GPU_SANITY_CHECK(d_src);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -1979,8 +1684,6 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_ImagePyramidGetLayer, Combine(GPU_TYPICAL_MAT_S
cv::Size dstSize(size.width / 2 + 10, size.height / 2 + 10);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -1996,12 +1699,6 @@ PERF_TEST_P(Sz_Depth_Cn, ImgProc_ImagePyramidGetLayer, Combine(GPU_TYPICAL_MAT_S
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -2064,8 +1761,6 @@ PERF_TEST_P(Sz, ImgProc_HoughLines, GPU_TYPICAL_MAT_SIZES)
}
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_lines;
@ -2084,12 +1779,6 @@ PERF_TEST_P(Sz, ImgProc_HoughLines, GPU_TYPICAL_MAT_SIZES)
std::sort(begin, end, Vec2fComparator());
SANITY_CHECK(h_lines);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
std::vector<cv::Vec2f> lines;
@ -2128,8 +1817,6 @@ PERF_TEST_P(Image, ImgProc_HoughLinesP, testing::Values("cv/shared/pic5.png", "s
cv::Canny(image, mask, 50, 100);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_mask(mask);
cv::gpu::GpuMat d_lines;
@ -2148,12 +1835,6 @@ PERF_TEST_P(Image, ImgProc_HoughLinesP, testing::Values("cv/shared/pic5.png", "s
std::sort(begin, end, Vec4iComparator());
SANITY_CHECK(h_lines);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
std::vector<cv::Vec4i> lines;
@ -2201,8 +1882,6 @@ PERF_TEST_P(Sz_Dp_MinDist, ImgProc_HoughCircles, Combine(GPU_TYPICAL_MAT_SIZES,
}
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_circles;
@ -2221,12 +1900,6 @@ PERF_TEST_P(Sz_Dp_MinDist, ImgProc_HoughCircles, Combine(GPU_TYPICAL_MAT_SIZES,
std::sort(begin, end, Vec3fComparator());
SANITY_CHECK(h_circles);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
std::vector<cv::Vec3f> circles;
@ -2293,8 +1966,6 @@ PERF_TEST_P(Method_Sz, ImgProc_GeneralizedHough, Combine(
cv::Sobel(image, dy, CV_32F, 0, 1);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_edges(edges);
cv::gpu::GpuMat d_dx(dx);
@ -2319,12 +1990,6 @@ PERF_TEST_P(Method_Sz, ImgProc_GeneralizedHough, Combine(
GPU_SANITY_CHECK(d_position);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat positions;

View File

@ -107,8 +107,6 @@ PERF_TEST_P(Image, Labeling_ConnectedComponents, Values<string>("gpu/labeling/al
cv::Mat image = readImage(GetParam(), cv::IMREAD_GRAYSCALE);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat mask;
mask.create(image.rows, image.cols, CV_8UC1);
@ -127,12 +125,6 @@ PERF_TEST_P(Image, Labeling_ConnectedComponents, Values<string>("gpu/labeling/al
GPU_SANITY_CHECK(components);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
GreedyLabeling host(image);

View File

@ -19,8 +19,6 @@ PERF_TEST_P(Sz_Depth_Cn, MatOp_SetTo, Combine(GPU_TYPICAL_MAT_SIZES, Values(CV_8
cv::Scalar val(1, 2, 3, 4);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(size, type);
@ -33,12 +31,6 @@ PERF_TEST_P(Sz_Depth_Cn, MatOp_SetTo, Combine(GPU_TYPICAL_MAT_SIZES, Values(CV_8
GPU_SANITY_CHECK(d_src);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat src(size, type);
@ -74,8 +66,6 @@ PERF_TEST_P(Sz_Depth_Cn, MatOp_SetToMasked, Combine(GPU_TYPICAL_MAT_SIZES, Value
cv::Scalar val(1, 2, 3, 4);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_mask(mask);
@ -89,12 +79,6 @@ PERF_TEST_P(Sz_Depth_Cn, MatOp_SetToMasked, Combine(GPU_TYPICAL_MAT_SIZES, Value
GPU_SANITY_CHECK(d_src);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
src.setTo(val, mask);
@ -126,8 +110,6 @@ PERF_TEST_P(Sz_Depth_Cn, MatOp_CopyToMasked, Combine(GPU_TYPICAL_MAT_SIZES, Valu
fillRandom(mask, 0, 2);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_mask(mask);
@ -142,12 +124,6 @@ PERF_TEST_P(Sz_Depth_Cn, MatOp_CopyToMasked, Combine(GPU_TYPICAL_MAT_SIZES, Valu
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;
@ -178,8 +154,6 @@ PERF_TEST_P(Sz_2Depth, MatOp_ConvertTo, Combine(GPU_TYPICAL_MAT_SIZES, Values(CV
fillRandom(src);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_src(src);
cv::gpu::GpuMat d_dst;
@ -193,12 +167,6 @@ PERF_TEST_P(Sz_2Depth, MatOp_ConvertTo, Combine(GPU_TYPICAL_MAT_SIZES, Values(CV
GPU_SANITY_CHECK(d_dst);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat dst;

View File

@ -18,8 +18,6 @@ PERF_TEST_P(Image, ObjDetect_HOG, Values<string>("gpu/hog/road.png"))
std::vector<cv::Rect> found_locations;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_img(img);
@ -33,12 +31,6 @@ PERF_TEST_P(Image, ObjDetect_HOG, Values<string>("gpu/hog/road.png"))
d_hog.detectMultiScale(d_img, found_locations);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::HOGDescriptor hog;
@ -68,8 +60,6 @@ PERF_TEST_P(HOG, CalTech, Values<string>("gpu/caltech/image_00000009_0.png", "gp
std::vector<cv::Rect> found_locations;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_img(img);
@ -83,12 +73,6 @@ PERF_TEST_P(HOG, CalTech, Values<string>("gpu/caltech/image_00000009_0.png", "gp
d_hog.detectMultiScale(d_img, found_locations);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::HOGDescriptor hog;
@ -118,8 +102,6 @@ PERF_TEST_P(ImageAndCascade, ObjDetect_HaarClassifier,
ASSERT_FALSE(img.empty());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::CascadeClassifier_GPU d_cascade;
ASSERT_TRUE(d_cascade.load(perf::TestBase::getDataPath(GetParam().second)));
@ -136,12 +118,6 @@ PERF_TEST_P(ImageAndCascade, ObjDetect_HaarClassifier,
GPU_SANITY_CHECK(d_objects_buffer);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::CascadeClassifier cascade;
@ -170,8 +146,6 @@ PERF_TEST_P(ImageAndCascade, ObjDetect_LBPClassifier,
ASSERT_FALSE(img.empty());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::CascadeClassifier_GPU d_cascade;
ASSERT_TRUE(d_cascade.load(perf::TestBase::getDataPath(GetParam().second)));
@ -188,12 +162,6 @@ PERF_TEST_P(ImageAndCascade, ObjDetect_LBPClassifier,
GPU_SANITY_CHECK(d_gpu_rects);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::CascadeClassifier cascade;

View File

@ -59,8 +59,6 @@ GPU_PERF_TEST_P(SCascadeTest, detect,
{ }
RUN_GPU(SCascadeTest, detect)
{
try
{
cv::Mat cpu = readImage (GET_PARAM(1));
ASSERT_FALSE(cpu.empty());
@ -85,12 +83,6 @@ RUN_GPU(SCascadeTest, detect)
SANITY_CHECK(sortDetections(objectBoxes));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
NO_CPU(SCascadeTest, detect)
@ -125,8 +117,6 @@ GPU_PERF_TEST_P(SCascadeTestRoi, detectInRoi,
{}
RUN_GPU(SCascadeTestRoi, detectInRoi)
{
try
{
cv::Mat cpu = readImage (GET_PARAM(1));
ASSERT_FALSE(cpu.empty());
@ -160,12 +150,6 @@ RUN_GPU(SCascadeTestRoi, detectInRoi)
SANITY_CHECK(sortDetections(objectBoxes));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
NO_CPU(SCascadeTestRoi, detectInRoi)
@ -178,8 +162,6 @@ GPU_PERF_TEST_P(SCascadeTestRoi, detectEachRoi,
{}
RUN_GPU(SCascadeTestRoi, detectEachRoi)
{
try
{
cv::Mat cpu = readImage (GET_PARAM(1));
ASSERT_FALSE(cpu.empty());
@ -209,12 +191,6 @@ RUN_GPU(SCascadeTestRoi, detectEachRoi)
SANITY_CHECK(sortDetections(objectBoxes));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
NO_CPU(SCascadeTestRoi, detectEachRoi)
@ -232,8 +208,6 @@ GPU_PERF_TEST_P(SCascadeTest, detectOnIntegral,
}
RUN_GPU(SCascadeTest, detectOnIntegral)
{
try
{
cv::FileStorage fsi(perf::TestBase::getDataPath(GET_PARAM(1)), cv::FileStorage::READ);
ASSERT_TRUE(fsi.isOpened());
@ -266,12 +240,6 @@ RUN_GPU(SCascadeTest, detectOnIntegral)
SANITY_CHECK(sortDetections(objectBoxes));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
NO_CPU(SCascadeTest, detectOnIntegral)
@ -282,8 +250,6 @@ GPU_PERF_TEST_P(SCascadeTest, detectStream,
{ }
RUN_GPU(SCascadeTest, detectStream)
{
try
{
cv::Mat cpu = readImage (GET_PARAM(1));
ASSERT_FALSE(cpu.empty());
@ -314,11 +280,5 @@ RUN_GPU(SCascadeTest, detectStream)
SANITY_CHECK(sortDetections(objectBoxes));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
NO_CPU(SCascadeTest, detectStream)

View File

@ -35,8 +35,6 @@ PERF_TEST_P(ImagePair, Video_BroxOpticalFlow,
frame1.convertTo(frame1, CV_32FC1, 1.0 / 255.0);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame0(frame0);
cv::gpu::GpuMat d_frame1(frame1);
@ -56,12 +54,6 @@ PERF_TEST_P(ImagePair, Video_BroxOpticalFlow,
GPU_SANITY_CHECK(d_u);
GPU_SANITY_CHECK(d_v);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -84,8 +76,6 @@ PERF_TEST_P(ImagePair, Video_InterpolateFrames,
frame1.convertTo(frame1, CV_32FC1, 1.0 / 255.0);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame0(frame0);
cv::gpu::GpuMat d_frame1(frame1);
@ -113,12 +103,6 @@ PERF_TEST_P(ImagePair, Video_InterpolateFrames,
GPU_SANITY_CHECK(d_bu);
GPU_SANITY_CHECK(d_bv);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -141,8 +125,6 @@ PERF_TEST_P(ImagePair, Video_CreateOpticalFlowNeedleMap,
frame1.convertTo(frame1, CV_32FC1, 1.0 / 255.0);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame0(frame0);
cv::gpu::GpuMat d_frame1(frame1);
@ -166,12 +148,6 @@ PERF_TEST_P(ImagePair, Video_CreateOpticalFlowNeedleMap,
GPU_SANITY_CHECK(d_vertex);
GPU_SANITY_CHECK(d_colors);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -193,8 +169,6 @@ PERF_TEST_P(Image_MinDistance, Video_GoodFeaturesToTrack,
ASSERT_FALSE(image.empty());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GoodFeaturesToTrackDetector_GPU d_detector(8000, 0.01, minDistance);
@ -210,12 +184,6 @@ PERF_TEST_P(Image_MinDistance, Video_GoodFeaturesToTrack,
GPU_SANITY_CHECK(d_pts);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat pts;
@ -269,8 +237,6 @@ PERF_TEST_P(ImagePair_Gray_NPts_WinSz_Levels_Iters, Video_PyrLKOpticalFlowSparse
cv::goodFeaturesToTrack(gray_frame, pts, points, 0.01, 0.0);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_pts(pts.reshape(2, 1));
@ -293,12 +259,6 @@ PERF_TEST_P(ImagePair_Gray_NPts_WinSz_Levels_Iters, Video_PyrLKOpticalFlowSparse
GPU_SANITY_CHECK(d_status);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat nextPts;
@ -344,8 +304,6 @@ PERF_TEST_P(ImagePair_WinSz_Levels_Iters, Video_PyrLKOpticalFlowDense, Combine(
ASSERT_FALSE(frame1.empty());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame0(frame0);
cv::gpu::GpuMat d_frame1(frame1);
@ -367,12 +325,6 @@ PERF_TEST_P(ImagePair_WinSz_Levels_Iters, Video_PyrLKOpticalFlowDense, Combine(
GPU_SANITY_CHECK(d_u);
GPU_SANITY_CHECK(d_v);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -402,8 +354,6 @@ PERF_TEST_P(ImagePair, Video_FarnebackOpticalFlow,
int flags = 0;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame0(frame0);
cv::gpu::GpuMat d_frame1(frame1);
@ -429,12 +379,6 @@ PERF_TEST_P(ImagePair, Video_FarnebackOpticalFlow,
GPU_SANITY_CHECK(d_u);
GPU_SANITY_CHECK(d_v);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat flow;
@ -465,8 +409,6 @@ PERF_TEST_P(ImagePair, Video_OpticalFlowDual_TVL1,
ASSERT_FALSE(frame1.empty());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame0(frame0);
cv::gpu::GpuMat d_frame1(frame1);
@ -485,12 +427,6 @@ PERF_TEST_P(ImagePair, Video_OpticalFlowDual_TVL1,
GPU_SANITY_CHECK(d_flowx);
GPU_SANITY_CHECK(d_flowy);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat flow;
@ -545,8 +481,6 @@ PERF_TEST_P(ImagePair, Video_OpticalFlowBM,
cv::Size max_range(16, 16);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame0(frame0);
cv::gpu::GpuMat d_frame1(frame1);
@ -562,12 +496,6 @@ PERF_TEST_P(ImagePair, Video_OpticalFlowBM,
GPU_SANITY_CHECK(d_velx);
GPU_SANITY_CHECK(d_vely);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat velx, vely;
@ -600,8 +528,6 @@ PERF_TEST_P(ImagePair, Video_FastOpticalFlowBM,
cv::Size max_range(16, 16);
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame0(frame0);
cv::gpu::GpuMat d_frame1(frame1);
@ -619,12 +545,6 @@ PERF_TEST_P(ImagePair, Video_FastOpticalFlowBM,
GPU_SANITY_CHECK(d_velx);
GPU_SANITY_CHECK(d_vely);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat velx, vely;
@ -660,8 +580,6 @@ PERF_TEST_P(Video, DISABLED_Video_FGDStatModel, Values("gpu/video/768x576.avi",
ASSERT_FALSE(frame.empty());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame(frame);
@ -680,12 +598,6 @@ PERF_TEST_P(Video, DISABLED_Video_FGDStatModel, Values("gpu/video/768x576.avi",
stopTimer();
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
IplImage ipl_frame = frame;
@ -736,8 +648,6 @@ PERF_TEST_P(Video_Cn_LearningRate, DISABLED_Video_MOG,
}
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame(frame);
cv::gpu::MOG_GPU d_mog;
@ -767,12 +677,6 @@ PERF_TEST_P(Video_Cn_LearningRate, DISABLED_Video_MOG,
stopTimer();
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::BackgroundSubtractorMOG mog;
@ -832,8 +736,6 @@ PERF_TEST_P(Video_Cn, DISABLED_Video_MOG2,
}
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame(frame);
cv::gpu::MOG2_GPU d_mog2;
@ -863,12 +765,6 @@ PERF_TEST_P(Video_Cn, DISABLED_Video_MOG2,
stopTimer();
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::BackgroundSubtractorMOG2 mog2;
@ -913,8 +809,6 @@ PERF_TEST_P(Video_Cn, Video_MOG2GetBackgroundImage,
cv::Mat frame;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame;
cv::gpu::MOG2_GPU d_mog2;
@ -950,12 +844,6 @@ PERF_TEST_P(Video_Cn, Video_MOG2GetBackgroundImage,
GPU_SANITY_CHECK(d_background);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::BackgroundSubtractorMOG2 mog2;
@ -1018,8 +906,6 @@ PERF_TEST_P(Video_Cn, DISABLED_Video_VIBE,
}
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame(frame);
cv::gpu::VIBE_GPU d_vibe;
@ -1049,12 +935,6 @@ PERF_TEST_P(Video_Cn, DISABLED_Video_VIBE,
stopTimer();
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
FAIL() << "No such CPU implementation analogy";
@ -1091,8 +971,6 @@ PERF_TEST_P(Video_Cn_MaxFeatures, DISABLED_Video_GMG,
}
if (PERF_RUN_GPU())
{
try
{
cv::gpu::GpuMat d_frame(frame);
cv::gpu::GpuMat d_fgmask;
@ -1129,12 +1007,6 @@ PERF_TEST_P(Video_Cn_MaxFeatures, DISABLED_Video_GMG,
stopTimer();
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::Mat fgmask;
@ -1193,8 +1065,6 @@ PERF_TEST_P(Video, Video_VideoWriter, Values("gpu/video/768x576.avi", "gpu/video
cv::Mat frame;
if (PERF_RUN_GPU())
{
try
{
cv::gpu::VideoWriter_GPU d_writer;
@ -1215,12 +1085,6 @@ PERF_TEST_P(Video, Video_VideoWriter, Values("gpu/video/768x576.avi", "gpu/video
stopTimer();
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::VideoWriter writer;
@ -1250,8 +1114,6 @@ PERF_TEST_P(Video, Video_VideoReader, Values("gpu/video/768x576.avi", "gpu/video
string inputFile = perf::TestBase::getDataPath(GetParam());
if (PERF_RUN_GPU())
{
try
{
cv::gpu::VideoReader_GPU d_reader(inputFile);
ASSERT_TRUE( d_reader.isOpened() );
@ -1267,12 +1129,6 @@ PERF_TEST_P(Video, Video_VideoReader, Values("gpu/video/768x576.avi", "gpu/video
GPU_SANITY_CHECK(d_frame);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
else
{
cv::VideoCapture reader(inputFile);

View File

@ -276,8 +276,6 @@ static void devNullOutput(const std::string& msg)
(void)msg;
}
}
bool nvidia_NPPST_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel)
{
path = test_data_path.c_str();
@ -294,6 +292,8 @@ bool nvidia_NPPST_Integral_Image(const std::string& test_data_path, OutputLevel
return testListerII.invoke();
}
}
bool nvidia_NPPST_Squared_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel)
{
path = test_data_path;

View File

@ -61,8 +61,6 @@ struct StereoBM : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(StereoBM, Regression)
{
try
{
cv::Mat left_image = readImage("stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);
cv::Mat right_image = readImage("stereobm/aloe-R.png", cv::IMREAD_GRAYSCALE);
@ -79,12 +77,6 @@ TEST_P(StereoBM, Regression)
EXPECT_MAT_NEAR(disp_gold, disp, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Calib3D, StereoBM, ALL_DEVICES);
@ -104,8 +96,6 @@ struct StereoBeliefPropagation : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(StereoBeliefPropagation, Regression)
{
try
{
cv::Mat left_image = readImage("stereobp/aloe-L.png");
cv::Mat right_image = readImage("stereobp/aloe-R.png");
@ -125,12 +115,6 @@ TEST_P(StereoBeliefPropagation, Regression)
EXPECT_MAT_NEAR(disp_gold, h_disp, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Calib3D, StereoBeliefPropagation, ALL_DEVICES);
@ -150,8 +134,6 @@ struct StereoConstantSpaceBP : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(StereoConstantSpaceBP, Regression)
{
try
{
cv::Mat left_image = readImage("csstereobp/aloe-L.png");
cv::Mat right_image = readImage("csstereobp/aloe-R.png");
@ -177,12 +159,6 @@ TEST_P(StereoConstantSpaceBP, Regression)
EXPECT_MAT_NEAR(disp_gold, h_disp, 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Calib3D, StereoConstantSpaceBP, ALL_DEVICES);
@ -202,8 +178,6 @@ struct TransformPoints : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(TransformPoints, Accuracy)
{
try
{
cv::Mat src = randomMat(cv::Size(1000, 1), CV_32FC3, 0, 10);
cv::Mat rvec = randomMat(cv::Size(3, 1), CV_32F, 0, 1);
@ -233,12 +207,6 @@ TEST_P(TransformPoints, Accuracy)
ASSERT_POINT3_NEAR(res_gold, res, 1e-5);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Calib3D, TransformPoints, ALL_DEVICES);
@ -258,8 +226,6 @@ struct ProjectPoints : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(ProjectPoints, Accuracy)
{
try
{
cv::Mat src = randomMat(cv::Size(1000, 1), CV_32FC3, 0, 10);
cv::Mat rvec = randomMat(cv::Size(3, 1), CV_32F, 0, 1);
@ -291,12 +257,6 @@ TEST_P(ProjectPoints, Accuracy)
ASSERT_LE(cv::norm(res_gold - res) / cv::norm(res_gold), 1e-3f);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Calib3D, ProjectPoints, ALL_DEVICES);
@ -316,8 +276,6 @@ struct SolvePnPRansac : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(SolvePnPRansac, Accuracy)
{
try
{
cv::Mat object = randomMat(cv::Size(5000, 1), CV_32FC3, 0, 100);
cv::Mat camera_mat = randomMat(cv::Size(3, 3), CV_32F, 0.5, 1);
@ -342,12 +300,6 @@ TEST_P(SolvePnPRansac, Accuracy)
ASSERT_LE(cv::norm(rvec - rvec_gold), 1e-3);
ASSERT_LE(cv::norm(tvec - tvec_gold), 1e-3);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Calib3D, SolvePnPRansac, ALL_DEVICES);
@ -373,8 +325,6 @@ PARAM_TEST_CASE(ReprojectImageTo3D, cv::gpu::DeviceInfo, cv::Size, MatDepth, Use
};
TEST_P(ReprojectImageTo3D, Accuracy)
{
try
{
cv::Mat disp = randomMat(size, depth, 5.0, 30.0);
cv::Mat Q = randomMat(cv::Size(4, 4), CV_32FC1, 0.1, 1.0);
@ -387,12 +337,6 @@ TEST_P(ReprojectImageTo3D, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, 1e-5);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Calib3D, ReprojectImageTo3D, testing::Combine(
ALL_DEVICES,

File diff suppressed because it is too large Load Diff

View File

@ -70,8 +70,6 @@ PARAM_TEST_CASE(CopyMakeBorder, cv::gpu::DeviceInfo, cv::Size, MatType, Border,
};
TEST_P(CopyMakeBorder, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
cv::Scalar val = randomScalar(0, 255);
@ -84,12 +82,6 @@ TEST_P(CopyMakeBorder, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, CopyMakeBorder, testing::Combine(
ALL_DEVICES,

File diff suppressed because it is too large Load Diff

View File

@ -70,8 +70,6 @@ PARAM_TEST_CASE(BilateralFilter, cv::gpu::DeviceInfo, cv::Size, MatType)
};
TEST_P(BilateralFilter, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
@ -85,12 +83,6 @@ TEST_P(BilateralFilter, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-3 : 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Denoising, BilateralFilter, testing::Combine(
ALL_DEVICES,
@ -114,8 +106,6 @@ struct BruteForceNonLocalMeans: testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(BruteForceNonLocalMeans, Regression)
{
try
{
using cv::gpu::GpuMat;
@ -141,15 +131,11 @@ TEST_P(BruteForceNonLocalMeans, Regression)
EXPECT_MAT_NEAR(bgr_gold, dbgr, 1e-4);
EXPECT_MAT_NEAR(gray_gold, dgray, 1e-4);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Denoising, BruteForceNonLocalMeans, ALL_DEVICES);
////////////////////////////////////////////////////////
// Fast Force Non local means
@ -165,8 +151,6 @@ struct FastNonLocalMeans: testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(FastNonLocalMeans, Regression)
{
try
{
using cv::gpu::GpuMat;
@ -194,13 +178,8 @@ TEST_P(FastNonLocalMeans, Regression)
EXPECT_MAT_NEAR(bgr_gold, dbgr, 1);
EXPECT_MAT_NEAR(gray_gold, dgray, 1);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Denoising, FastNonLocalMeans, ALL_DEVICES);
#endif // HAVE_CUDA

View File

@ -179,8 +179,6 @@ PARAM_TEST_CASE(SURF, cv::gpu::DeviceInfo, SURF_HessianThreshold, SURF_Octaves,
};
TEST_P(SURF, Detector)
{
try
{
cv::Mat image = readImage("features2d/aloe.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(image.empty());
@ -193,6 +191,20 @@ TEST_P(SURF, Detector)
surf.upright = upright;
surf.keypointsRatio = 0.05f;
if (!supportFeature(devInfo, cv::gpu::GLOBAL_ATOMICS))
{
try
{
std::vector<cv::KeyPoint> keypoints;
surf(loadMat(image), cv::gpu::GpuMat(), keypoints);
}
catch (const cv::Exception& e)
{
ASSERT_EQ(CV_StsNotImplemented, e.code);
}
}
else
{
std::vector<cv::KeyPoint> keypoints;
surf(loadMat(image), cv::gpu::GpuMat(), keypoints);
@ -212,16 +224,9 @@ TEST_P(SURF, Detector)
EXPECT_GT(matchedRatio, 0.95);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(SURF, Detector_Masked)
{
try
{
cv::Mat image = readImage("features2d/aloe.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(image.empty());
@ -237,6 +242,20 @@ TEST_P(SURF, Detector_Masked)
surf.upright = upright;
surf.keypointsRatio = 0.05f;
if (!supportFeature(devInfo, cv::gpu::GLOBAL_ATOMICS))
{
try
{
std::vector<cv::KeyPoint> keypoints;
surf(loadMat(image), loadMat(mask), keypoints);
}
catch (const cv::Exception& e)
{
ASSERT_EQ(CV_StsNotImplemented, e.code);
}
}
else
{
std::vector<cv::KeyPoint> keypoints;
surf(loadMat(image), loadMat(mask), keypoints);
@ -256,16 +275,9 @@ TEST_P(SURF, Detector_Masked)
EXPECT_GT(matchedRatio, 0.95);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(SURF, Descriptor)
{
try
{
cv::Mat image = readImage("features2d/aloe.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(image.empty());
@ -285,6 +297,21 @@ TEST_P(SURF, Descriptor)
surf_gold.extended = extended;
surf_gold.upright = upright;
if (!supportFeature(devInfo, cv::gpu::GLOBAL_ATOMICS))
{
try
{
std::vector<cv::KeyPoint> keypoints;
cv::gpu::GpuMat descriptors;
surf(loadMat(image), cv::gpu::GpuMat(), keypoints, descriptors);
}
catch (const cv::Exception& e)
{
ASSERT_EQ(CV_StsNotImplemented, e.code);
}
}
else
{
std::vector<cv::KeyPoint> keypoints;
surf_gold(image, cv::noArray(), keypoints);
@ -303,11 +330,6 @@ TEST_P(SURF, Descriptor)
EXPECT_GT(matchedRatio, 0.6);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Features2D, SURF, testing::Combine(
@ -341,8 +363,6 @@ PARAM_TEST_CASE(FAST, cv::gpu::DeviceInfo, FAST_Threshold, FAST_NonmaxSupression
};
TEST_P(FAST, Accuracy)
{
try
{
cv::Mat image = readImage("features2d/aloe.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(image.empty());
@ -350,6 +370,20 @@ TEST_P(FAST, Accuracy)
cv::gpu::FAST_GPU fast(threshold);
fast.nonmaxSupression = nonmaxSupression;
if (!supportFeature(devInfo, cv::gpu::GLOBAL_ATOMICS))
{
try
{
std::vector<cv::KeyPoint> keypoints;
fast(loadMat(image), cv::gpu::GpuMat(), keypoints);
}
catch (const cv::Exception& e)
{
ASSERT_EQ(CV_StsNotImplemented, e.code);
}
}
else
{
std::vector<cv::KeyPoint> keypoints;
fast(loadMat(image), cv::gpu::GpuMat(), keypoints);
@ -358,11 +392,6 @@ TEST_P(FAST, Accuracy)
ASSERT_KEYPOINTS_EQ(keypoints_gold, keypoints);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Features2D, FAST, testing::Combine(
@ -415,8 +444,6 @@ PARAM_TEST_CASE(ORB, cv::gpu::DeviceInfo, ORB_FeaturesCount, ORB_ScaleFactor, OR
};
TEST_P(ORB, Accuracy)
{
try
{
cv::Mat image = readImage("features2d/aloe.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(image.empty());
@ -427,6 +454,21 @@ TEST_P(ORB, Accuracy)
cv::gpu::ORB_GPU orb(nFeatures, scaleFactor, nLevels, edgeThreshold, firstLevel, WTA_K, scoreType, patchSize);
orb.blurForDescriptor = blurForDescriptor;
if (!supportFeature(devInfo, cv::gpu::GLOBAL_ATOMICS))
{
try
{
std::vector<cv::KeyPoint> keypoints;
cv::gpu::GpuMat descriptors;
orb(loadMat(image), loadMat(mask), keypoints, descriptors);
}
catch (const cv::Exception& e)
{
ASSERT_EQ(CV_StsNotImplemented, e.code);
}
}
else
{
std::vector<cv::KeyPoint> keypoints;
cv::gpu::GpuMat descriptors;
orb(loadMat(image), loadMat(mask), keypoints, descriptors);
@ -446,11 +488,6 @@ TEST_P(ORB, Accuracy)
EXPECT_GT(matchedRatio, 0.35);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Features2D, ORB, testing::Combine(
@ -532,8 +569,6 @@ PARAM_TEST_CASE(BruteForceMatcher, cv::gpu::DeviceInfo, NormCode, DescriptorSize
};
TEST_P(BruteForceMatcher, Match_Single)
{
try
{
cv::gpu::BFMatcher_GPU matcher(normCode);
@ -559,16 +594,8 @@ TEST_P(BruteForceMatcher, Match_Single)
ASSERT_EQ(0, badCount);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(BruteForceMatcher, Match_Collection)
{
try
{
cv::gpu::BFMatcher_GPU matcher(normCode);
@ -621,16 +648,8 @@ TEST_P(BruteForceMatcher, Match_Collection)
ASSERT_EQ(0, badCount);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(BruteForceMatcher, KnnMatch_2_Single)
{
try
{
cv::gpu::BFMatcher_GPU matcher(normCode);
@ -668,16 +687,8 @@ TEST_P(BruteForceMatcher, KnnMatch_2_Single)
ASSERT_EQ(0, badCount);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(BruteForceMatcher, KnnMatch_3_Single)
{
try
{
cv::gpu::BFMatcher_GPU matcher(normCode);
@ -715,16 +726,8 @@ TEST_P(BruteForceMatcher, KnnMatch_3_Single)
ASSERT_EQ(0, badCount);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(BruteForceMatcher, KnnMatch_2_Collection)
{
try
{
cv::gpu::BFMatcher_GPU matcher(normCode);
@ -785,16 +788,8 @@ TEST_P(BruteForceMatcher, KnnMatch_2_Collection)
ASSERT_EQ(0, badCount);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(BruteForceMatcher, KnnMatch_3_Collection)
{
try
{
cv::gpu::BFMatcher_GPU matcher(normCode);
@ -855,16 +850,8 @@ TEST_P(BruteForceMatcher, KnnMatch_3_Collection)
ASSERT_EQ(0, badCount);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(BruteForceMatcher, RadiusMatch_Single)
{
try
{
cv::gpu::BFMatcher_GPU matcher(normCode);
@ -912,16 +899,8 @@ TEST_P(BruteForceMatcher, RadiusMatch_Single)
ASSERT_EQ(0, badCount);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(BruteForceMatcher, RadiusMatch_Collection)
{
try
{
cv::gpu::BFMatcher_GPU matcher(normCode);
@ -943,6 +922,20 @@ TEST_P(BruteForceMatcher, RadiusMatch_Collection)
masks[mi].col(di * countFactor).setTo(cv::Scalar::all(0));
}
if (!supportFeature(devInfo, cv::gpu::GLOBAL_ATOMICS))
{
try
{
std::vector< std::vector<cv::DMatch> > matches;
matcher.radiusMatch(cv::gpu::GpuMat(query), matches, radius, masks);
}
catch (const cv::Exception& e)
{
ASSERT_EQ(CV_StsNotImplemented, e.code);
}
}
else
{
std::vector< std::vector<cv::DMatch> > matches;
if (useMask)
@ -984,11 +977,6 @@ TEST_P(BruteForceMatcher, RadiusMatch_Collection)
ASSERT_EQ(0, badCount);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Features2D, BruteForceMatcher, testing::Combine(

View File

@ -87,8 +87,6 @@ PARAM_TEST_CASE(Blur, cv::gpu::DeviceInfo, cv::Size, MatType, KSize, Anchor, Use
};
TEST_P(Blur, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
@ -100,12 +98,6 @@ TEST_P(Blur, Accuracy)
EXPECT_MAT_NEAR(getInnerROI(dst_gold, ksize), getInnerROI(dst, ksize), 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Filter, Blur, testing::Combine(
ALL_DEVICES,
@ -158,8 +150,6 @@ TEST_P(Sobel, Accuracy)
if (dx == 0 && dy == 0)
return;
try
{
cv::Mat src = randomMat(size, type);
cv::gpu::GpuMat dst = createMat(size, type, useRoi);
@ -170,12 +160,6 @@ TEST_P(Sobel, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, CV_MAT_DEPTH(type) < CV_32F ? 0.0 : 0.1);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Filter, Sobel, testing::Combine(
ALL_DEVICES,
@ -229,8 +213,6 @@ TEST_P(Scharr, Accuracy)
if (dx + dy != 1)
return;
try
{
cv::Mat src = randomMat(size, type);
cv::gpu::GpuMat dst = createMat(size, type, useRoi);
@ -241,12 +223,6 @@ TEST_P(Scharr, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, CV_MAT_DEPTH(type) < CV_32F ? 0.0 : 0.1);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Filter, Scharr, testing::Combine(
ALL_DEVICES,
@ -293,8 +269,6 @@ PARAM_TEST_CASE(GaussianBlur, cv::gpu::DeviceInfo, cv::Size, MatDepth, Channels,
};
TEST_P(GaussianBlur, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
double sigma1 = randomDouble(0.1, 1.0);
@ -323,12 +297,6 @@ TEST_P(GaussianBlur, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, 4.0);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Filter, GaussianBlur, testing::Combine(
ALL_DEVICES,
@ -380,8 +348,6 @@ PARAM_TEST_CASE(Laplacian, cv::gpu::DeviceInfo, cv::Size, MatType, KSize, UseRoi
};
TEST_P(Laplacian, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
@ -393,12 +359,6 @@ TEST_P(Laplacian, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() < CV_32F ? 0.0 : 1e-3);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Filter, Laplacian, testing::Combine(
ALL_DEVICES,
@ -435,8 +395,6 @@ PARAM_TEST_CASE(Erode, cv::gpu::DeviceInfo, cv::Size, MatType, Anchor, Iteration
};
TEST_P(Erode, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
cv::Mat kernel = cv::Mat::ones(3, 3, CV_8U);
@ -451,12 +409,6 @@ TEST_P(Erode, Accuracy)
EXPECT_MAT_NEAR(getInnerROI(dst_gold, ksize), getInnerROI(dst, ksize), 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Filter, Erode, testing::Combine(
ALL_DEVICES,
@ -492,8 +444,6 @@ PARAM_TEST_CASE(Dilate, cv::gpu::DeviceInfo, cv::Size, MatType, Anchor, Iteratio
};
TEST_P(Dilate, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
cv::Mat kernel = cv::Mat::ones(3, 3, CV_8U);
@ -508,12 +458,6 @@ TEST_P(Dilate, Accuracy)
EXPECT_MAT_NEAR(getInnerROI(dst_gold, ksize), getInnerROI(dst, ksize), 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Filter, Dilate, testing::Combine(
ALL_DEVICES,
@ -554,8 +498,6 @@ PARAM_TEST_CASE(MorphEx, cv::gpu::DeviceInfo, cv::Size, MatType, MorphOp, Anchor
};
TEST_P(MorphEx, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
cv::Mat kernel = cv::Mat::ones(3, 3, CV_8U);
@ -570,12 +512,6 @@ TEST_P(MorphEx, Accuracy)
EXPECT_MAT_NEAR(getInnerROI(dst_gold, border), getInnerROI(dst, border), 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Filter, MorphEx, testing::Combine(
ALL_DEVICES,
@ -616,8 +552,6 @@ PARAM_TEST_CASE(Filter2D, cv::gpu::DeviceInfo, cv::Size, MatType, KSize, Anchor,
};
TEST_P(Filter2D, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
cv::Mat kernel = randomMat(cv::Size(ksize.width, ksize.height), CV_32FC1, 0.0, 1.0);
@ -630,12 +564,6 @@ TEST_P(Filter2D, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, CV_MAT_DEPTH(type) == CV_32F ? 1e-1 : 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Filter, Filter2D, testing::Combine(
ALL_DEVICES,

View File

@ -52,8 +52,6 @@ struct CompactPoints : testing::TestWithParam<gpu::DeviceInfo>
};
TEST_P(CompactPoints, CanCompactizeSmallInput)
{
try
{
Mat src0(1, 3, CV_32FC2);
src0.at<Point2f>(0,0) = Point2f(0,0);
@ -85,12 +83,6 @@ TEST_P(CompactPoints, CanCompactizeSmallInput)
ASSERT_TRUE(src1.at<Point2f>(0,0) == Point2f(1,0));
ASSERT_TRUE(src1.at<Point2f>(0,1) == Point2f(1,2));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_GlobalMotion, CompactPoints, ALL_DEVICES);

View File

@ -68,8 +68,6 @@ PARAM_TEST_CASE(SetTo, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
};
TEST_P(SetTo, Zero)
{
try
{
cv::Scalar zero = cv::Scalar::all(0);
@ -78,16 +76,8 @@ TEST_P(SetTo, Zero)
EXPECT_MAT_NEAR(cv::Mat::zeros(size, type), mat, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(SetTo, SameVal)
{
try
{
cv::Scalar val = cv::Scalar::all(randomDouble(0.0, 255.0));
@ -111,16 +101,8 @@ TEST_P(SetTo, SameVal)
EXPECT_MAT_NEAR(cv::Mat(size, type, val), mat, 0.0);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(SetTo, DifferentVal)
{
try
{
cv::Scalar val = randomScalar(0.0, 255.0);
@ -144,16 +126,8 @@ TEST_P(SetTo, DifferentVal)
EXPECT_MAT_NEAR(cv::Mat(size, type, val), mat, 0.0);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(SetTo, Masked)
{
try
{
cv::Scalar val = randomScalar(0.0, 255.0);
cv::Mat mat_gold = randomMat(size, type);
@ -181,12 +155,6 @@ TEST_P(SetTo, Masked)
EXPECT_MAT_NEAR(mat_gold, mat, 0.0);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_GpuMat, SetTo, testing::Combine(
ALL_DEVICES,
@ -217,8 +185,6 @@ PARAM_TEST_CASE(CopyTo, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
};
TEST_P(CopyTo, WithOutMask)
{
try
{
cv::Mat src = randomMat(size, type);
@ -228,16 +194,8 @@ TEST_P(CopyTo, WithOutMask)
EXPECT_MAT_NEAR(src, dst, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(CopyTo, Masked)
{
try
{
cv::Mat src = randomMat(size, type);
cv::Mat mask = randomMat(size, CV_8UC1, 0.0, 2.0);
@ -267,12 +225,6 @@ TEST_P(CopyTo, Masked)
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_GpuMat, CopyTo, testing::Combine(
ALL_DEVICES,
@ -304,8 +256,6 @@ PARAM_TEST_CASE(ConvertTo, cv::gpu::DeviceInfo, cv::Size, MatDepth, MatDepth, Us
};
TEST_P(ConvertTo, WithOutScaling)
{
try
{
cv::Mat src = randomMat(size, depth1);
@ -334,16 +284,8 @@ TEST_P(ConvertTo, WithOutScaling)
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(ConvertTo, WithScaling)
{
try
{
cv::Mat src = randomMat(size, depth1);
double a = randomDouble(0.0, 1.0);
@ -374,12 +316,6 @@ TEST_P(ConvertTo, WithScaling)
EXPECT_MAT_NEAR(dst_gold, dst, depth2 < CV_32F ? 1.0 : 1e-4);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_GpuMat, ConvertTo, testing::Combine(
ALL_DEVICES,
@ -401,8 +337,6 @@ struct EnsureSizeIsEnough : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(EnsureSizeIsEnough, BufferReuse)
{
try
{
cv::gpu::GpuMat buffer(100, 100, CV_8U);
cv::gpu::GpuMat old = buffer;
@ -421,12 +355,6 @@ TEST_P(EnsureSizeIsEnough, BufferReuse)
EXPECT_EQ(CV_8UC1, buffer.type());
EXPECT_EQ(reinterpret_cast<intptr_t>(old.data), reinterpret_cast<intptr_t>(buffer.data));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_GpuMat, EnsureSizeIsEnough, ALL_DEVICES);

View File

@ -80,8 +80,6 @@ PARAM_TEST_CASE(HoughLines, cv::gpu::DeviceInfo, cv::Size, UseRoi)
};
TEST_P(HoughLines, Accuracy)
{
try
{
const cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
@ -90,7 +88,7 @@ TEST_P(HoughLines, Accuracy)
const float rho = 1.0f;
const float theta = (float) (1.5 * CV_PI / 180.0);
const int threshold = 100;
onst int threshold = 100;
cv::Mat src(size, CV_8UC1);
generateLines(src);
@ -106,12 +104,6 @@ TEST_P(HoughLines, Accuracy)
ASSERT_MAT_NEAR(src, dst, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, HoughLines, testing::Combine(
ALL_DEVICES,
@ -133,8 +125,6 @@ PARAM_TEST_CASE(HoughCircles, cv::gpu::DeviceInfo, cv::Size, UseRoi)
};
TEST_P(HoughCircles, Accuracy)
{
try
{
const cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
@ -185,12 +175,6 @@ TEST_P(HoughCircles, Accuracy)
ASSERT_TRUE(found);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, HoughCircles, testing::Combine(
ALL_DEVICES,
@ -205,8 +189,6 @@ PARAM_TEST_CASE(GeneralizedHough, cv::gpu::DeviceInfo, UseRoi)
};
TEST_P(GeneralizedHough, POSITION)
{
try
{
const cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
@ -264,12 +246,6 @@ TEST_P(GeneralizedHough, POSITION)
ASSERT_TRUE(found);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, GeneralizedHough, testing::Combine(
ALL_DEVICES,

View File

@ -65,8 +65,6 @@ PARAM_TEST_CASE(Integral, cv::gpu::DeviceInfo, cv::Size, UseRoi)
};
TEST_P(Integral, Accuracy)
{
try
{
cv::Mat src = randomMat(size, CV_8UC1);
@ -78,12 +76,6 @@ TEST_P(Integral, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Integral, testing::Combine(
ALL_DEVICES,
@ -106,8 +98,6 @@ struct HistEven : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(HistEven, Accuracy)
{
try
{
cv::Mat img = readImage("stereobm/aloe-L.png");
ASSERT_FALSE(img.empty());
@ -136,12 +126,6 @@ TEST_P(HistEven, Accuracy)
EXPECT_MAT_NEAR(hist_gold, hist, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, HistEven, ALL_DEVICES);
@ -179,8 +163,6 @@ PARAM_TEST_CASE(CalcHist, cv::gpu::DeviceInfo, cv::Size)
};
TEST_P(CalcHist, Accuracy)
{
try
{
cv::Mat src = randomMat(size, CV_8UC1);
@ -192,12 +174,6 @@ TEST_P(CalcHist, Accuracy)
EXPECT_MAT_NEAR(hist_gold, hist, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, CalcHist, testing::Combine(
ALL_DEVICES,
@ -221,8 +197,6 @@ PARAM_TEST_CASE(EqualizeHist, cv::gpu::DeviceInfo, cv::Size)
};
TEST_P(EqualizeHist, Accuracy)
{
try
{
cv::Mat src = randomMat(size, CV_8UC1);
@ -234,12 +208,6 @@ TEST_P(EqualizeHist, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, 3.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, EqualizeHist, testing::Combine(
ALL_DEVICES,
@ -263,8 +231,6 @@ PARAM_TEST_CASE(ColumnSum, cv::gpu::DeviceInfo, cv::Size)
};
TEST_P(ColumnSum, Accuracy)
{
try
{
cv::Mat src = randomMat(size, CV_32FC1);
@ -290,12 +256,6 @@ TEST_P(ColumnSum, Accuracy)
}
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, ColumnSum, testing::Combine(
ALL_DEVICES,
@ -326,8 +286,6 @@ PARAM_TEST_CASE(Canny, cv::gpu::DeviceInfo, AppertureSize, L2gradient, UseRoi)
};
TEST_P(Canny, Accuracy)
{
try
{
cv::Mat img = readImage("stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(img.empty());
@ -358,12 +316,6 @@ TEST_P(Canny, Accuracy)
EXPECT_MAT_SIMILAR(edges_gold, edges, 2e-2);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Canny, testing::Combine(
ALL_DEVICES,
@ -398,8 +350,6 @@ struct MeanShift : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(MeanShift, Filtering)
{
try
{
cv::Mat img_template;
if (supportFeature(devInfo, cv::gpu::FEATURE_SET_COMPUTE_20))
@ -420,16 +370,8 @@ TEST_P(MeanShift, Filtering)
EXPECT_MAT_NEAR(img_template, result, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(MeanShift, Proc)
{
try
{
cv::FileStorage fs;
if (supportFeature(devInfo, cv::gpu::FEATURE_SET_COMPUTE_20))
@ -454,12 +396,6 @@ TEST_P(MeanShift, Proc)
EXPECT_MAT_NEAR(rmap_filtered, rmap, 0.0);
EXPECT_MAT_NEAR(spmap_template, spmap, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, MeanShift, ALL_DEVICES);
@ -483,8 +419,6 @@ PARAM_TEST_CASE(MeanShiftSegmentation, cv::gpu::DeviceInfo, MinSize)
};
TEST_P(MeanShiftSegmentation, Regression)
{
try
{
cv::Mat img = readImageType("meanshift/cones.png", CV_8UC4);
ASSERT_FALSE(img.empty());
@ -506,12 +440,6 @@ TEST_P(MeanShiftSegmentation, Regression)
EXPECT_MAT_SIMILAR(dst_gold, dst_rgb, 1e-3);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, MeanShiftSegmentation, testing::Combine(
ALL_DEVICES,
@ -563,8 +491,6 @@ PARAM_TEST_CASE(Blend, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
};
TEST_P(Blend, Accuracy)
{
try
{
int depth = CV_MAT_DEPTH(type);
@ -584,12 +510,6 @@ TEST_P(Blend, Accuracy)
EXPECT_MAT_NEAR(result_gold, result, CV_MAT_DEPTH(type) == CV_8U ? 1.0 : 1e-5);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Blend, testing::Combine(
ALL_DEVICES,
@ -661,8 +581,6 @@ PARAM_TEST_CASE(Convolve, cv::gpu::DeviceInfo, cv::Size, KSize, Ccorr)
};
TEST_P(Convolve, Accuracy)
{
try
{
cv::Mat src = randomMat(size, CV_32FC1, 0.0, 100.0);
cv::Mat kernel = randomMat(cv::Size(ksize, ksize), CV_32FC1, 0.0, 1.0);
@ -675,12 +593,6 @@ TEST_P(Convolve, Accuracy)
EXPECT_MAT_NEAR(dst, dst_gold, 1e-1);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Convolve, testing::Combine(
ALL_DEVICES,
@ -717,8 +629,6 @@ PARAM_TEST_CASE(MatchTemplate8U, cv::gpu::DeviceInfo, cv::Size, TemplateSize, Ch
};
TEST_P(MatchTemplate8U, Accuracy)
{
try
{
cv::Mat image = randomMat(size, CV_MAKETYPE(CV_8U, cn));
cv::Mat templ = randomMat(templ_size, CV_MAKETYPE(CV_8U, cn));
@ -731,12 +641,6 @@ TEST_P(MatchTemplate8U, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, templ_size.area() * 1e-1);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, MatchTemplate8U, testing::Combine(
ALL_DEVICES,
@ -771,8 +675,6 @@ PARAM_TEST_CASE(MatchTemplate32F, cv::gpu::DeviceInfo, cv::Size, TemplateSize, C
};
TEST_P(MatchTemplate32F, Regression)
{
try
{
cv::Mat image = randomMat(size, CV_MAKETYPE(CV_32F, cn));
cv::Mat templ = randomMat(templ_size, CV_MAKETYPE(CV_32F, cn));
@ -785,12 +687,6 @@ TEST_P(MatchTemplate32F, Regression)
EXPECT_MAT_NEAR(dst_gold, dst, templ_size.area() * 1e-1);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, MatchTemplate32F, testing::Combine(
ALL_DEVICES,
@ -817,8 +713,6 @@ PARAM_TEST_CASE(MatchTemplateBlackSource, cv::gpu::DeviceInfo, TemplateMethod)
};
TEST_P(MatchTemplateBlackSource, Accuracy)
{
try
{
cv::Mat image = readImage("matchtemplate/black.png");
ASSERT_FALSE(image.empty());
@ -839,12 +733,6 @@ TEST_P(MatchTemplateBlackSource, Accuracy)
ASSERT_EQ(maxLocGold, maxLoc);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, MatchTemplateBlackSource, testing::Combine(
ALL_DEVICES,
@ -870,8 +758,6 @@ PARAM_TEST_CASE(MatchTemplate_CCOEF_NORMED, cv::gpu::DeviceInfo, std::pair<std::
};
TEST_P(MatchTemplate_CCOEF_NORMED, Accuracy)
{
try
{
cv::Mat image = readImage(imageName);
ASSERT_FALSE(image.empty());
@ -900,12 +786,6 @@ TEST_P(MatchTemplate_CCOEF_NORMED, Accuracy)
ASSERT_LE(maxVal, 1.0);
ASSERT_GE(minVal, -1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, MatchTemplate_CCOEF_NORMED, testing::Combine(
ALL_DEVICES,
@ -927,8 +807,6 @@ struct MatchTemplate_CanFindBigTemplate : testing::TestWithParam<cv::gpu::Device
};
TEST_P(MatchTemplate_CanFindBigTemplate, SQDIFF_NORMED)
{
try
{
cv::Mat scene = readImage("matchtemplate/scene.png");
ASSERT_FALSE(scene.empty());
@ -950,16 +828,8 @@ TEST_P(MatchTemplate_CanFindBigTemplate, SQDIFF_NORMED)
ASSERT_EQ(344, minLoc.x);
ASSERT_EQ(0, minLoc.y);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(MatchTemplate_CanFindBigTemplate, SQDIFF)
{
try
{
cv::Mat scene = readImage("matchtemplate/scene.png");
ASSERT_FALSE(scene.empty());
@ -980,12 +850,6 @@ TEST_P(MatchTemplate_CanFindBigTemplate, SQDIFF)
ASSERT_EQ(344, minLoc.x);
ASSERT_EQ(0, minLoc.y);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, MatchTemplate_CanFindBigTemplate, ALL_DEVICES);
@ -1016,8 +880,6 @@ PARAM_TEST_CASE(MulSpectrums, cv::gpu::DeviceInfo, cv::Size, DftFlags)
};
TEST_P(MulSpectrums, Simple)
{
try
{
cv::gpu::GpuMat c;
cv::gpu::mulSpectrums(loadMat(a), loadMat(b), c, flag, false);
@ -1027,16 +889,8 @@ TEST_P(MulSpectrums, Simple)
EXPECT_MAT_NEAR(c_gold, c, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(MulSpectrums, Scaled)
{
try
{
float scale = 1.f / size.area();
@ -1049,12 +903,6 @@ TEST_P(MulSpectrums, Scaled)
EXPECT_MAT_NEAR(c_gold, c, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, MulSpectrums, testing::Combine(
ALL_DEVICES,
@ -1101,8 +949,6 @@ void testC2C(const std::string& hint, int cols, int rows, int flags, bool inplac
}
TEST_P(Dft, C2C)
{
try
{
int cols = randomInt(2, 100);
int rows = randomInt(2, 100);
@ -1126,12 +972,6 @@ TEST_P(Dft, C2C)
testC2C("size 2 1", 2, 1, 0, inplace);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
void testR2CThenC2R(const std::string& hint, int cols, int rows, bool inplace)
{
@ -1170,8 +1010,6 @@ void testR2CThenC2R(const std::string& hint, int cols, int rows, bool inplace)
}
TEST_P(Dft, R2CThenC2R)
{
try
{
int cols = randomInt(2, 100);
int rows = randomInt(2, 100);
@ -1192,12 +1030,6 @@ TEST_P(Dft, R2CThenC2R)
testR2CThenC2R("single row", cols, 1, true);
testR2CThenC2R("single row 1", cols + 1, 1, true);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Dft, ALL_DEVICES);
@ -1228,8 +1060,6 @@ PARAM_TEST_CASE(CornerHarris, cv::gpu::DeviceInfo, MatType, BorderType, BlockSiz
};
TEST_P(CornerHarris, Accuracy)
{
try
{
cv::Mat src = readImageType("stereobm/aloe-L.png", type);
ASSERT_FALSE(src.empty());
@ -1244,12 +1074,6 @@ TEST_P(CornerHarris, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, 0.02);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, CornerHarris, testing::Combine(
ALL_DEVICES,
@ -1282,8 +1106,6 @@ PARAM_TEST_CASE(CornerMinEigen, cv::gpu::DeviceInfo, MatType, BorderType, BlockS
};
TEST_P(CornerMinEigen, Accuracy)
{
try
{
cv::Mat src = readImageType("stereobm/aloe-L.png", type);
ASSERT_FALSE(src.empty());
@ -1296,12 +1118,6 @@ TEST_P(CornerMinEigen, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, 0.02);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, CornerMinEigen, testing::Combine(
ALL_DEVICES,

View File

@ -167,8 +167,6 @@ struct Labeling : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(Labeling, ConnectedComponents)
{
try
{
cv::Mat image;
cvtColor(loat_image(), image, CV_BGR2GRAY);
@ -192,12 +190,6 @@ TEST_P(Labeling, ConnectedComponents)
host.checkCorrectness(cv::Mat(components));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(ConnectedComponents, Labeling, ALL_DEVICES);

View File

@ -69,170 +69,83 @@ struct NVidiaTest : TestWithParam<cv::gpu::DeviceInfo>
struct NPPST : NVidiaTest {};
struct NCV : NVidiaTest {};
TEST_P(NPPST, Integral)
{
try
{
bool res = nvidia_NPPST_Integral_Image(_path, nvidiaTestOutputLevel);
//TEST_P(NPPST, Integral)
//{
// bool res = nvidia_NPPST_Integral_Image(path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
// ASSERT_TRUE(res);
//}
TEST_P(NPPST, SquaredIntegral)
{
try
{
bool res = nvidia_NPPST_Squared_Integral_Image(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(NPPST, RectStdDev)
{
try
{
bool res = nvidia_NPPST_RectStdDev(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(NPPST, Resize)
{
try
{
bool res = nvidia_NPPST_Resize(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(NPPST, VectorOperations)
{
try
{
bool res = nvidia_NPPST_Vector_Operations(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(NPPST, Transpose)
{
try
{
bool res = nvidia_NPPST_Transpose(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(NCV, VectorOperations)
{
try
{
bool res = nvidia_NCV_Vector_Operations(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(NCV, HaarCascadeLoader)
{
try
{
bool res = nvidia_NCV_Haar_Cascade_Loader(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(NCV, HaarCascadeApplication)
{
try
{
bool res = nvidia_NCV_Haar_Cascade_Application(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(NCV, HypothesesFiltration)
{
try
{
bool res = nvidia_NCV_Hypotheses_Filtration(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(NCV, Visualization)
{
try
{
// this functionality doesn't used in gpu module
bool res = nvidia_NCV_Visualization(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_NVidia, NPPST, ALL_DEVICES);
INSTANTIATE_TEST_CASE_P(GPU_NVidia, NCV, ALL_DEVICES);

View File

@ -175,9 +175,8 @@ struct HOG : testing::TestWithParam<cv::gpu::DeviceInfo>, cv::gpu::HOGDescriptor
}
};
TEST_P(HOG, Detect)
{
try
// desabled while resize does not fixed
TEST_P(HOG, DISABLED_Detect)
{
cv::Mat img_rgb = readImage("hog/road.png");
ASSERT_FALSE(img_rgb.empty());
@ -201,16 +200,8 @@ TEST_P(HOG, Detect)
f.close();
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(HOG, GetDescriptors)
{
try
{
// Load image (e.g. train data, composed from windows)
cv::Mat img_rgb = readImage("hog/train_data.png");
@ -293,12 +284,6 @@ TEST_P(HOG, GetDescriptors)
computeBlockHistograms(cv::gpu::GpuMat(img));
compare_inner_parts(cv::Mat(block_hists), cv::Mat(descriptors.rowRange(5, 6)));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, HOG, ALL_DEVICES);
@ -319,8 +304,6 @@ struct CalTech : public ::testing::TestWithParam<std::tr1::tuple<cv::gpu::Device
};
TEST_P(CalTech, HOG)
{
try
{
cv::gpu::GpuMat d_img(img);
cv::Mat markedImage(img.clone());
@ -344,12 +327,6 @@ TEST_P(CalTech, HOG)
cv::imshow("Res", markedImage); cv::waitKey();
#endif
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(detect, CalTech, testing::Combine(ALL_DEVICES,
::testing::Values<std::string>("caltech/image_00000009_0.png", "caltech/image_00000032_0.png",
@ -374,19 +351,11 @@ PARAM_TEST_CASE(LBP_Read_classifier, cv::gpu::DeviceInfo, int)
};
TEST_P(LBP_Read_classifier, Accuracy)
{
try
{
cv::gpu::CascadeClassifier_GPU classifier;
std::string classifierXmlPath = std::string(cvtest::TS::ptr()->get_data_path()) + "lbpcascade/lbpcascade_frontalface.xml";
ASSERT_TRUE(classifier.load(classifierXmlPath));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_Read_classifier,
testing::Combine(ALL_DEVICES, testing::Values<int>(0)));
@ -404,8 +373,6 @@ PARAM_TEST_CASE(LBP_classify, cv::gpu::DeviceInfo, int)
};
TEST_P(LBP_classify, Accuracy)
{
try
{
std::string classifierXmlPath = std::string(cvtest::TS::ptr()->get_data_path()) + "lbpcascade/lbpcascade_frontalface.xml";
std::string imagePath = std::string(cvtest::TS::ptr()->get_data_path()) + "lbpcascade/er.png";
@ -451,12 +418,6 @@ TEST_P(LBP_classify, Accuracy)
#endif
(void)count;
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_classify,
testing::Combine(ALL_DEVICES, testing::Values<int>(0)));

View File

@ -69,8 +69,6 @@ PARAM_TEST_CASE(GlBuffer, cv::Size, MatType)
};
TEST_P(GlBuffer, Constructor1)
{
try
{
cv::GlBuffer buf(size.height, size.width, type, cv::GlBuffer::ARRAY_BUFFER, true);
@ -78,16 +76,8 @@ TEST_P(GlBuffer, Constructor1)
EXPECT_EQ(size.width, buf.cols());
EXPECT_EQ(type, buf.type());
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, Constructor2)
{
try
{
cv::GlBuffer buf(size, type, cv::GlBuffer::ARRAY_BUFFER, true);
@ -95,16 +85,8 @@ TEST_P(GlBuffer, Constructor2)
EXPECT_EQ(size.width, buf.cols());
EXPECT_EQ(type, buf.type());
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, ConstructorFromMat)
{
try
{
cv::Mat gold = randomMat(size, type);
@ -115,16 +97,8 @@ TEST_P(GlBuffer, ConstructorFromMat)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, ConstructorFromGpuMat)
{
try
{
cv::Mat gold = randomMat(size, type);
cv::gpu::GpuMat d_gold(gold);
@ -136,16 +110,8 @@ TEST_P(GlBuffer, ConstructorFromGpuMat)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, ConstructorFromGlBuffer)
{
try
{
cv::GlBuffer buf_gold(size, type, cv::GlBuffer::ARRAY_BUFFER, true);
@ -156,16 +122,8 @@ TEST_P(GlBuffer, ConstructorFromGlBuffer)
EXPECT_EQ(buf_gold.cols(), buf.cols());
EXPECT_EQ(buf_gold.type(), buf.type());
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, ConstructorFromGlTexture2D)
{
try
{
const int depth = CV_MAT_DEPTH(type);
const int cn = CV_MAT_CN(type);
@ -183,16 +141,8 @@ TEST_P(GlBuffer, ConstructorFromGlTexture2D)
EXPECT_MAT_NEAR(gold, bufData, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, Create)
{
try
{
cv::GlBuffer buf;
buf.create(size.height, size.width, type, cv::GlBuffer::ARRAY_BUFFER, true);
@ -201,16 +151,8 @@ TEST_P(GlBuffer, Create)
EXPECT_EQ(size.width, buf.cols());
EXPECT_EQ(type, buf.type());
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, CopyFromMat)
{
try
{
cv::Mat gold = randomMat(size, type);
@ -222,16 +164,8 @@ TEST_P(GlBuffer, CopyFromMat)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, CopyFromGpuMat)
{
try
{
cv::Mat gold = randomMat(size, type);
cv::gpu::GpuMat d_gold(gold);
@ -244,16 +178,8 @@ TEST_P(GlBuffer, CopyFromGpuMat)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, CopyFromGlBuffer)
{
try
{
cv::Mat gold = randomMat(size, type);
cv::GlBuffer buf_gold(gold, cv::GlBuffer::ARRAY_BUFFER, true);
@ -268,16 +194,8 @@ TEST_P(GlBuffer, CopyFromGlBuffer)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, CopyFromGlTexture2D)
{
try
{
const int depth = CV_MAT_DEPTH(type);
const int cn = CV_MAT_CN(type);
@ -296,16 +214,8 @@ TEST_P(GlBuffer, CopyFromGlTexture2D)
EXPECT_MAT_NEAR(gold, bufData, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, CopyToGpuMat)
{
try
{
cv::Mat gold = randomMat(size, type);
@ -316,16 +226,8 @@ TEST_P(GlBuffer, CopyToGpuMat)
EXPECT_MAT_NEAR(gold, dst, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, CopyToGlBuffer)
{
try
{
cv::Mat gold = randomMat(size, type);
@ -341,16 +243,8 @@ TEST_P(GlBuffer, CopyToGlBuffer)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, CopyToGlTexture2D)
{
try
{
const int depth = CV_MAT_DEPTH(type);
const int cn = CV_MAT_CN(type);
@ -370,16 +264,8 @@ TEST_P(GlBuffer, CopyToGlTexture2D)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, Clone)
{
try
{
cv::Mat gold = randomMat(size, type);
@ -394,16 +280,8 @@ TEST_P(GlBuffer, Clone)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, MapHostRead)
{
try
{
cv::Mat gold = randomMat(size, type);
@ -415,16 +293,8 @@ TEST_P(GlBuffer, MapHostRead)
buf.unmapHost();
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, MapHostWrite)
{
try
{
cv::Mat gold = randomMat(size, type);
@ -440,16 +310,8 @@ TEST_P(GlBuffer, MapHostWrite)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlBuffer, MapDevice)
{
try
{
cv::Mat gold = randomMat(size, type);
@ -461,12 +323,6 @@ TEST_P(GlBuffer, MapDevice)
buf.unmapDevice();
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(OpenGL, GlBuffer, testing::Combine(DIFFERENT_SIZES, ALL_TYPES));
@ -503,8 +359,6 @@ PARAM_TEST_CASE(GlTexture2D, cv::Size, MatType)
};
TEST_P(GlTexture2D, Constructor1)
{
try
{
cv::GlTexture2D tex(size.height, size.width, format, true);
@ -512,16 +366,8 @@ TEST_P(GlTexture2D, Constructor1)
EXPECT_EQ(size.width, tex.cols());
EXPECT_EQ(format, tex.format());
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, Constructor2)
{
try
{
cv::GlTexture2D tex(size, format, true);
@ -529,16 +375,8 @@ TEST_P(GlTexture2D, Constructor2)
EXPECT_EQ(size.width, tex.cols());
EXPECT_EQ(format, tex.format());
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, ConstructorFromMat)
{
try
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
@ -549,16 +387,8 @@ TEST_P(GlTexture2D, ConstructorFromMat)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, ConstructorFromGpuMat)
{
try
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
cv::gpu::GpuMat d_gold(gold);
@ -570,16 +400,8 @@ TEST_P(GlTexture2D, ConstructorFromGpuMat)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, ConstructorFromGlBuffer)
{
try
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
cv::GlBuffer buf_gold(gold, cv::GlBuffer::PIXEL_UNPACK_BUFFER, true);
@ -591,16 +413,8 @@ TEST_P(GlTexture2D, ConstructorFromGlBuffer)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, ConstructorFromGlTexture2D)
{
try
{
cv::GlTexture2D tex_gold(size, format, true);
cv::GlTexture2D tex(tex_gold);
@ -610,16 +424,8 @@ TEST_P(GlTexture2D, ConstructorFromGlTexture2D)
EXPECT_EQ(tex_gold.cols(), tex.cols());
EXPECT_EQ(tex_gold.format(), tex.format());
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, Create)
{
try
{
cv::GlTexture2D tex;
tex.create(size.height, size.width, format, true);
@ -628,16 +434,8 @@ TEST_P(GlTexture2D, Create)
EXPECT_EQ(size.width, tex.cols());
EXPECT_EQ(format, tex.format());
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, CopyFromMat)
{
try
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
@ -649,16 +447,8 @@ TEST_P(GlTexture2D, CopyFromMat)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, CopyFromGpuMat)
{
try
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
cv::gpu::GpuMat d_gold(gold);
@ -671,16 +461,8 @@ TEST_P(GlTexture2D, CopyFromGpuMat)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, CopyFromGlBuffer)
{
try
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
cv::GlBuffer buf_gold(gold, cv::GlBuffer::PIXEL_UNPACK_BUFFER, true);
@ -693,16 +475,8 @@ TEST_P(GlTexture2D, CopyFromGlBuffer)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, CopyToGpuMat)
{
try
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
@ -713,16 +487,8 @@ TEST_P(GlTexture2D, CopyToGpuMat)
EXPECT_MAT_NEAR(gold, dst, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GlTexture2D, CopyToGlBuffer)
{
try
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
@ -736,12 +502,6 @@ TEST_P(GlTexture2D, CopyToGlBuffer)
EXPECT_MAT_NEAR(gold, bufData, 1e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(OpenGL, GlTexture2D, testing::Combine(DIFFERENT_SIZES, testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_32FC1, CV_32FC3, CV_32FC4)));

View File

@ -65,8 +65,6 @@ PARAM_TEST_CASE(PyrDown, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
};
TEST_P(PyrDown, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
@ -78,12 +76,6 @@ TEST_P(PyrDown, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-4 : 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, PyrDown, testing::Combine(
ALL_DEVICES,
@ -113,8 +105,6 @@ PARAM_TEST_CASE(PyrUp, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
};
TEST_P(PyrUp, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
@ -126,12 +116,6 @@ TEST_P(PyrUp, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-4 : 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, PyrUp, testing::Combine(
ALL_DEVICES,

View File

@ -153,8 +153,6 @@ PARAM_TEST_CASE(Remap, cv::gpu::DeviceInfo, cv::Size, MatType, Interpolation, Bo
};
TEST_P(Remap, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
cv::Scalar val = randomScalar(0.0, 255.0);
@ -167,12 +165,6 @@ TEST_P(Remap, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-3 : 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Remap, testing::Combine(
ALL_DEVICES,

View File

@ -137,8 +137,6 @@ PARAM_TEST_CASE(Resize, cv::gpu::DeviceInfo, cv::Size, MatType, double, Interpol
};
TEST_P(Resize, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
@ -150,12 +148,6 @@ TEST_P(Resize, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-2 : 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Resize, testing::Combine(
ALL_DEVICES,
@ -191,8 +183,6 @@ PARAM_TEST_CASE(ResizeSameAsHost, cv::gpu::DeviceInfo, cv::Size, MatType, double
// downscaling only: used for classifiers
TEST_P(ResizeSameAsHost, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
@ -204,12 +194,6 @@ TEST_P(ResizeSameAsHost, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-2 : 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, ResizeSameAsHost, testing::Combine(
ALL_DEVICES,
@ -241,8 +225,6 @@ PARAM_TEST_CASE(ResizeNPP, cv::gpu::DeviceInfo, MatType, double, Interpolation)
};
TEST_P(ResizeNPP, Accuracy)
{
try
{
cv::Mat src = readImageType("stereobp/aloe-L.png", type);
ASSERT_FALSE(src.empty());
@ -255,12 +237,6 @@ TEST_P(ResizeNPP, Accuracy)
EXPECT_MAT_SIMILAR(dst_gold, dst, 1e-1);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, ResizeNPP, testing::Combine(
ALL_DEVICES,

View File

@ -40,7 +40,7 @@
//
//M*/
#include "test_precomp.hpp"
#include <test_precomp.hpp>
#include <time.h>
#ifdef HAVE_CUDA
@ -157,8 +157,6 @@ GPU_TEST_P(SCascadeTestRoi, detect,
testing::Values(std::string("cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml")),
testing::Values(std::string("../cv/cascadeandhog/bahnhof/image_00000000_0.png")),
testing::Range(0, 5)))
{
try
{
cv::gpu::setDevice(GET_PARAM(0).deviceID());
cv::Mat coloredCpu = cv::imread(cvtest::TS::ptr()->get_data_path() + GET_PARAM(2));
@ -204,17 +202,10 @@ GPU_TEST_P(SCascadeTestRoi, detect,
}
SHOW(result);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST(SCascadeTest, readCascade)
{
try
{
std::string xml = cvtest::TS::ptr()->get_data_path() + "../cv/cascadeandhog/icf-template.xml";
cv::gpu::SCascade cascade;
@ -224,19 +215,11 @@ TEST(SCascadeTest, readCascade)
ASSERT_TRUE(cascade.load(fs.getFirstTopLevelNode()));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
typedef ::testing::TestWithParam<cv::gpu::DeviceInfo > SCascadeTestAll;
GPU_TEST_P(SCascadeTestAll, detect,
ALL_DEVICES
)
{
try
{
cv::gpu::setDevice(GetParam().deviceID());
std::string xml = cvtest::TS::ptr()->get_data_path() + "../cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml";
@ -264,18 +247,10 @@ GPU_TEST_P(SCascadeTestAll, detect,
int a = *(detections.ptr<int>(0));
ASSERT_EQ(a ,2448);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
GPU_TEST_P(SCascadeTestAll, detectOnIntegral,
ALL_DEVICES
)
{
try
{
cv::gpu::setDevice(GetParam().deviceID());
std::string xml = cvtest::TS::ptr()->get_data_path() + "../cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml";
@ -311,18 +286,10 @@ GPU_TEST_P(SCascadeTestAll, detectOnIntegral,
ASSERT_EQ( a ,1024);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
GPU_TEST_P(SCascadeTestAll, detectStream,
ALL_DEVICES
)
{
try
{
cv::gpu::setDevice(GetParam().deviceID());
std::string xml = cvtest::TS::ptr()->get_data_path() + "../cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml";
@ -353,12 +320,6 @@ GPU_TEST_P(SCascadeTestAll, detectStream,
int a = *(detections.ptr<int>(0));
ASSERT_EQ(a ,2448);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
#endif

View File

@ -67,8 +67,6 @@ PARAM_TEST_CASE(Threshold, cv::gpu::DeviceInfo, cv::Size, MatType, ThreshOp, Use
};
TEST_P(Threshold, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
double maxVal = randomDouble(20.0, 127.0);
@ -82,12 +80,6 @@ TEST_P(Threshold, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Threshold, testing::Combine(
ALL_DEVICES,

View File

@ -64,8 +64,6 @@ struct BroxOpticalFlow : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(BroxOpticalFlow, Regression)
{
try
{
cv::Mat frame0 = readImageType("opticalflow/frame0.png", CV_32FC1);
ASSERT_FALSE(frame0.empty());
@ -126,14 +124,9 @@ TEST_P(BroxOpticalFlow, Regression)
for (int i = 0; i < v.rows; ++i)
f.write(h_v.ptr<char>(i), v.cols * sizeof(float));
#endif
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, BroxOpticalFlow, ALL_DEVICES);
@ -157,8 +150,6 @@ PARAM_TEST_CASE(GoodFeaturesToTrack, cv::gpu::DeviceInfo, MinDistance)
};
TEST_P(GoodFeaturesToTrack, Accuracy)
{
try
{
cv::Mat image = readImage("opticalflow/frame0.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(image.empty());
@ -168,6 +159,20 @@ TEST_P(GoodFeaturesToTrack, Accuracy)
cv::gpu::GoodFeaturesToTrackDetector_GPU detector(maxCorners, qualityLevel, minDistance);
if (!supportFeature(devInfo, cv::gpu::GLOBAL_ATOMICS))
{
try
{
cv::gpu::GpuMat d_pts;
detector(loadMat(image), d_pts);
}
catch (const cv::Exception& e)
{
ASSERT_EQ(CV_StsNotImplemented, e.code);
}
}
else
{
cv::gpu::GpuMat d_pts;
detector(loadMat(image), d_pts);
@ -196,16 +201,9 @@ TEST_P(GoodFeaturesToTrack, Accuracy)
ASSERT_LE(bad_ratio, 0.01);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(GoodFeaturesToTrack, EmptyCorners)
{
try
{
int maxCorners = 1000;
double qualityLevel = 0.01;
@ -219,12 +217,6 @@ TEST_P(GoodFeaturesToTrack, EmptyCorners)
ASSERT_TRUE( corners.empty() );
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, GoodFeaturesToTrack, testing::Combine(
ALL_DEVICES,
@ -250,8 +242,6 @@ PARAM_TEST_CASE(PyrLKOpticalFlow, cv::gpu::DeviceInfo, UseGray)
};
TEST_P(PyrLKOpticalFlow, Sparse)
{
try
{
cv::Mat frame0 = readImage("opticalflow/frame0.png", useGray ? cv::IMREAD_GRAYSCALE : cv::IMREAD_COLOR);
ASSERT_FALSE(frame0.empty());
@ -318,12 +308,6 @@ TEST_P(PyrLKOpticalFlow, Sparse)
ASSERT_LE(bad_ratio, 0.01);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, PyrLKOpticalFlow, testing::Combine(
ALL_DEVICES,
@ -358,8 +342,6 @@ PARAM_TEST_CASE(FarnebackOpticalFlow, cv::gpu::DeviceInfo, PyrScale, PolyN, Farn
};
TEST_P(FarnebackOpticalFlow, Accuracy)
{
try
{
cv::Mat frame0 = readImage("opticalflow/rubberwhale1.png", cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(frame0.empty());
@ -401,12 +383,6 @@ TEST_P(FarnebackOpticalFlow, Accuracy)
EXPECT_MAT_SIMILAR(flowxy[0], d_flowx, 0.1);
EXPECT_MAT_SIMILAR(flowxy[1], d_flowy, 0.1);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, FarnebackOpticalFlow, testing::Combine(
ALL_DEVICES,
@ -418,8 +394,6 @@ INSTANTIATE_TEST_CASE_P(GPU_Video, FarnebackOpticalFlow, testing::Combine(
struct OpticalFlowNan : public BroxOpticalFlow {};
TEST_P(OpticalFlowNan, Regression)
{
try
{
cv::Mat frame0 = readImageType("opticalflow/frame0.png", CV_32FC1);
ASSERT_FALSE(frame0.empty());
@ -442,12 +416,6 @@ TEST_P(OpticalFlowNan, Regression)
v.download(h_v);
EXPECT_TRUE(cv::checkRange(h_u));
EXPECT_TRUE(cv::checkRange(h_v));
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
};
INSTANTIATE_TEST_CASE_P(GPU_Video, OpticalFlowNan, ALL_DEVICES);
@ -460,8 +428,6 @@ PARAM_TEST_CASE(OpticalFlowDual_TVL1, cv::gpu::DeviceInfo, UseRoi)
};
TEST_P(OpticalFlowDual_TVL1, Accuracy)
{
try
{
cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
@ -488,12 +454,6 @@ TEST_P(OpticalFlowDual_TVL1, Accuracy)
EXPECT_MAT_SIMILAR(gold[0], d_flowx, 3e-3);
EXPECT_MAT_SIMILAR(gold[1], d_flowy, 3e-3);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, OpticalFlowDual_TVL1, testing::Combine(
ALL_DEVICES,
@ -525,8 +485,6 @@ struct OpticalFlowBM : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(OpticalFlowBM, Accuracy)
{
try
{
cv::gpu::DeviceInfo devInfo = GetParam();
cv::gpu::setDevice(devInfo.deviceID());
@ -552,12 +510,6 @@ TEST_P(OpticalFlowBM, Accuracy)
EXPECT_MAT_NEAR(velx, d_velx, 0);
EXPECT_MAT_NEAR(vely, d_vely, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, OpticalFlowBM, ALL_DEVICES);
@ -633,8 +585,6 @@ struct FastOpticalFlowBM : testing::TestWithParam<cv::gpu::DeviceInfo>
};
TEST_P(FastOpticalFlowBM, Accuracy)
{
try
{
const double MAX_RMSE = 0.6;
@ -675,12 +625,6 @@ TEST_P(FastOpticalFlowBM, Accuracy)
err = calc_rmse(flowy, cv::Mat(d_flowy));
EXPECT_LE(err, MAX_RMSE);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, FastOpticalFlowBM, ALL_DEVICES);
@ -713,8 +657,6 @@ PARAM_TEST_CASE(FGDStatModel, cv::gpu::DeviceInfo, std::string, Channels)
};
TEST_P(FGDStatModel, Update)
{
try
{
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
@ -767,12 +709,6 @@ TEST_P(FGDStatModel, Update)
ASSERT_MAT_NEAR(gold_foreground, h_foreground, 0.0);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, FGDStatModel, testing::Combine(
ALL_DEVICES,
@ -808,8 +744,6 @@ PARAM_TEST_CASE(MOG, cv::gpu::DeviceInfo, std::string, UseGray, LearningRate, Us
};
TEST_P(MOG, Update)
{
try
{
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
@ -843,12 +777,6 @@ TEST_P(MOG, Update)
ASSERT_MAT_NEAR(foreground_gold, foreground, 0.0);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, MOG, testing::Combine(
ALL_DEVICES,
@ -881,8 +809,6 @@ PARAM_TEST_CASE(MOG2, cv::gpu::DeviceInfo, std::string, UseGray, UseRoi)
};
TEST_P(MOG2, Update)
{
try
{
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
@ -920,20 +846,12 @@ TEST_P(MOG2, Update)
ASSERT_LE(norm, 0.09);
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
TEST_P(MOG2, getBackgroundImage)
{
if (useGray)
return;
try
{
cv::VideoCapture cap(inputFile);
ASSERT_TRUE(cap.isOpened());
@ -963,12 +881,6 @@ TEST_P(MOG2, getBackgroundImage)
ASSERT_MAT_NEAR(background_gold, background, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, MOG2, testing::Combine(
ALL_DEVICES,
@ -984,8 +896,6 @@ PARAM_TEST_CASE(VIBE, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
};
TEST_P(VIBE, Accuracy)
{
try
{
const cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
@ -1012,12 +922,6 @@ TEST_P(VIBE, Accuracy)
// now fgmask should be entirely foreground
ASSERT_MAT_NEAR(fullfg, d_fgmask, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, VIBE, testing::Combine(
ALL_DEVICES,
@ -1033,8 +937,6 @@ PARAM_TEST_CASE(GMG, cv::gpu::DeviceInfo, cv::Size, MatDepth, Channels, UseRoi)
};
TEST_P(GMG, Accuracy)
{
try
{
const cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
@ -1073,12 +975,6 @@ TEST_P(GMG, Accuracy)
// now fgmask should be entirely foreground
ASSERT_MAT_NEAR(fullfg, d_fgmask, 0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, GMG, testing::Combine(
ALL_DEVICES,
@ -1112,8 +1008,6 @@ PARAM_TEST_CASE(VideoWriter, cv::gpu::DeviceInfo, std::string)
};
TEST_P(VideoWriter, Regression)
{
try
{
const double FPS = 25.0;
@ -1150,12 +1044,6 @@ TEST_P(VideoWriter, Regression)
ASSERT_FALSE( frame.empty() );
}
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, VideoWriter, testing::Combine(
ALL_DEVICES,
@ -1181,8 +1069,6 @@ PARAM_TEST_CASE(VideoReader, cv::gpu::DeviceInfo, std::string)
};
TEST_P(VideoReader, Regression)
{
try
{
cv::gpu::VideoReader_GPU reader(inputFile);
ASSERT_TRUE( reader.isOpened() );
@ -1198,12 +1084,6 @@ TEST_P(VideoReader, Regression)
reader.close();
ASSERT_FALSE( reader.isOpened() );
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_Video, VideoReader, testing::Combine(
ALL_DEVICES,

View File

@ -75,8 +75,6 @@ PARAM_TEST_CASE(BuildWarpAffineMaps, cv::gpu::DeviceInfo, cv::Size, Inverse)
};
TEST_P(BuildWarpAffineMaps, Accuracy)
{
try
{
cv::Mat M = createTransfomMatrix(size, CV_PI / 4);
cv::gpu::GpuMat xmap, ymap;
@ -97,12 +95,6 @@ TEST_P(BuildWarpAffineMaps, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, BuildWarpAffineMaps, testing::Combine(
ALL_DEVICES,
@ -208,8 +200,6 @@ PARAM_TEST_CASE(WarpAffine, cv::gpu::DeviceInfo, cv::Size, MatType, Inverse, Int
};
TEST_P(WarpAffine, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
cv::Mat M = createTransfomMatrix(size, CV_PI / 3);
@ -226,12 +216,6 @@ TEST_P(WarpAffine, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-1 : 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, WarpAffine, testing::Combine(
ALL_DEVICES,
@ -264,8 +248,6 @@ PARAM_TEST_CASE(WarpAffineNPP, cv::gpu::DeviceInfo, MatType, Inverse, Interpolat
};
TEST_P(WarpAffineNPP, Accuracy)
{
try
{
cv::Mat src = readImageType("stereobp/aloe-L.png", type);
cv::Mat M = createTransfomMatrix(src.size(), CV_PI / 4);
@ -281,12 +263,6 @@ TEST_P(WarpAffineNPP, Accuracy)
EXPECT_MAT_SIMILAR(dst_gold, dst, 2e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, WarpAffineNPP, testing::Combine(
ALL_DEVICES,

View File

@ -76,8 +76,6 @@ PARAM_TEST_CASE(BuildWarpPerspectiveMaps, cv::gpu::DeviceInfo, cv::Size, Inverse
};
TEST_P(BuildWarpPerspectiveMaps, Accuracy)
{
try
{
cv::Mat M = createTransfomMatrix(size, CV_PI / 4);
cv::gpu::GpuMat xmap, ymap;
@ -95,12 +93,6 @@ TEST_P(BuildWarpPerspectiveMaps, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, BuildWarpPerspectiveMaps, testing::Combine(
ALL_DEVICES,
@ -208,8 +200,6 @@ PARAM_TEST_CASE(WarpPerspective, cv::gpu::DeviceInfo, cv::Size, MatType, Inverse
};
TEST_P(WarpPerspective, Accuracy)
{
try
{
cv::Mat src = randomMat(size, type);
cv::Mat M = createTransfomMatrix(size, CV_PI / 3);
@ -226,12 +216,6 @@ TEST_P(WarpPerspective, Accuracy)
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-1 : 1.0);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, WarpPerspective, testing::Combine(
ALL_DEVICES,
@ -264,8 +248,6 @@ PARAM_TEST_CASE(WarpPerspectiveNPP, cv::gpu::DeviceInfo, MatType, Inverse, Inter
};
TEST_P(WarpPerspectiveNPP, Accuracy)
{
try
{
cv::Mat src = readImageType("stereobp/aloe-L.png", type);
cv::Mat M = createTransfomMatrix(src.size(), CV_PI / 4);
@ -281,12 +263,6 @@ TEST_P(WarpPerspectiveNPP, Accuracy)
EXPECT_MAT_SIMILAR(dst_gold, dst, 2e-2);
}
catch (...)
{
cv::gpu::resetDevice();
throw;
}
}
INSTANTIATE_TEST_CASE_P(GPU_ImgProc, WarpPerspectiveNPP, testing::Combine(
ALL_DEVICES,