Commit 1a76242d authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

added GPU_TEST_P macros

parent 4ba33fa1
......@@ -276,6 +276,8 @@ 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();
......@@ -292,8 +294,6 @@ 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;
......@@ -439,4 +439,4 @@ bool nvidia_NCV_Visualization(const std::string& test_data_path, OutputLevel out
return testListerVisualize.invoke();
}
#endif /* CUDA_DISABLER */
\ No newline at end of file
#endif /* CUDA_DISABLER */
This diff is collapsed.
......@@ -43,8 +43,6 @@
#ifdef HAVE_CUDA
namespace {
//////////////////////////////////////////////////////////////////////////
// StereoBM
......@@ -60,7 +58,7 @@ struct StereoBM : testing::TestWithParam<cv::gpu::DeviceInfo>
}
};
TEST_P(StereoBM, Regression)
GPU_TEST_P(StereoBM, Regression)
{
cv::Mat left_image = readImage("stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE);
cv::Mat right_image = readImage("stereobm/aloe-R.png", cv::IMREAD_GRAYSCALE);
......@@ -95,7 +93,7 @@ struct StereoBeliefPropagation : testing::TestWithParam<cv::gpu::DeviceInfo>
}
};
TEST_P(StereoBeliefPropagation, Regression)
GPU_TEST_P(StereoBeliefPropagation, Regression)
{
cv::Mat left_image = readImage("stereobp/aloe-L.png");
cv::Mat right_image = readImage("stereobp/aloe-R.png");
......@@ -133,7 +131,7 @@ struct StereoConstantSpaceBP : testing::TestWithParam<cv::gpu::DeviceInfo>
}
};
TEST_P(StereoConstantSpaceBP, Regression)
GPU_TEST_P(StereoConstantSpaceBP, Regression)
{
cv::Mat left_image = readImage("csstereobp/aloe-L.png");
cv::Mat right_image = readImage("csstereobp/aloe-R.png");
......@@ -177,7 +175,7 @@ struct TransformPoints : testing::TestWithParam<cv::gpu::DeviceInfo>
}
};
TEST_P(TransformPoints, Accuracy)
GPU_TEST_P(TransformPoints, Accuracy)
{
cv::Mat src = randomMat(cv::Size(1000, 1), CV_32FC3, 0, 10);
cv::Mat rvec = randomMat(cv::Size(3, 1), CV_32F, 0, 1);
......@@ -225,7 +223,7 @@ struct ProjectPoints : testing::TestWithParam<cv::gpu::DeviceInfo>
}
};
TEST_P(ProjectPoints, Accuracy)
GPU_TEST_P(ProjectPoints, Accuracy)
{
cv::Mat src = randomMat(cv::Size(1000, 1), CV_32FC3, 0, 10);
cv::Mat rvec = randomMat(cv::Size(3, 1), CV_32F, 0, 1);
......@@ -275,7 +273,7 @@ struct SolvePnPRansac : testing::TestWithParam<cv::gpu::DeviceInfo>
}
};
TEST_P(SolvePnPRansac, Accuracy)
GPU_TEST_P(SolvePnPRansac, Accuracy)
{
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);
......@@ -324,7 +322,7 @@ PARAM_TEST_CASE(ReprojectImageTo3D, cv::gpu::DeviceInfo, cv::Size, MatDepth, Use
}
};
TEST_P(ReprojectImageTo3D, Accuracy)
GPU_TEST_P(ReprojectImageTo3D, Accuracy)
{
cv::Mat disp = randomMat(size, depth, 5.0, 30.0);
cv::Mat Q = randomMat(cv::Size(4, 4), CV_32FC1, 0.1, 1.0);
......@@ -344,6 +342,4 @@ INSTANTIATE_TEST_CASE_P(GPU_Calib3D, ReprojectImageTo3D, testing::Combine(
testing::Values(MatDepth(CV_8U), MatDepth(CV_16S)),
WHOLE_SUBMAT));
} // namespace
#endif // HAVE_CUDA
This diff is collapsed.
......@@ -43,9 +43,10 @@
#ifdef HAVE_CUDA
namespace {
IMPLEMENT_PARAM_CLASS(Border, int)
namespace
{
IMPLEMENT_PARAM_CLASS(Border, int)
}
PARAM_TEST_CASE(CopyMakeBorder, cv::gpu::DeviceInfo, cv::Size, MatType, Border, BorderType, UseRoi)
{
......@@ -69,7 +70,7 @@ PARAM_TEST_CASE(CopyMakeBorder, cv::gpu::DeviceInfo, cv::Size, MatType, Border,
}
};
TEST_P(CopyMakeBorder, Accuracy)
GPU_TEST_P(CopyMakeBorder, Accuracy)
{
cv::Mat src = randomMat(size, type);
cv::Scalar val = randomScalar(0, 255);
......@@ -99,6 +100,4 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, CopyMakeBorder, testing::Combine(
ALL_BORDER_TYPES,
WHOLE_SUBMAT));
} // namespace
#endif // HAVE_CUDA
This diff is collapsed.
......@@ -69,7 +69,7 @@ PARAM_TEST_CASE(BilateralFilter, cv::gpu::DeviceInfo, cv::Size, MatType)
}
};
TEST_P(BilateralFilter, Accuracy)
GPU_TEST_P(BilateralFilter, Accuracy)
{
cv::Mat src = randomMat(size, type);
......@@ -105,7 +105,7 @@ struct BruteForceNonLocalMeans: testing::TestWithParam<cv::gpu::DeviceInfo>
}
};
TEST_P(BruteForceNonLocalMeans, Regression)
GPU_TEST_P(BruteForceNonLocalMeans, Regression)
{
using cv::gpu::GpuMat;
......@@ -134,8 +134,6 @@ TEST_P(BruteForceNonLocalMeans, Regression)
INSTANTIATE_TEST_CASE_P(GPU_Denoising, BruteForceNonLocalMeans, ALL_DEVICES);
////////////////////////////////////////////////////////
// Fast Force Non local means
......@@ -150,7 +148,7 @@ struct FastNonLocalMeans: testing::TestWithParam<cv::gpu::DeviceInfo>
}
};
TEST_P(FastNonLocalMeans, Regression)
GPU_TEST_P(FastNonLocalMeans, Regression)
{
using cv::gpu::GpuMat;
......@@ -167,8 +165,8 @@ TEST_P(FastNonLocalMeans, Regression)
fnlmd.labMethod(GpuMat(bgr), dbgr, 20, 10);
#if 0
//dumpImage("denoising/fnlm_denoised_lena_bgr.png", cv::Mat(dbgr));
//dumpImage("denoising/fnlm_denoised_lena_gray.png", cv::Mat(dgray));
dumpImage("denoising/fnlm_denoised_lena_bgr.png", cv::Mat(dbgr));
dumpImage("denoising/fnlm_denoised_lena_gray.png", cv::Mat(dgray));
#endif
cv::Mat bgr_gold = readImage("denoising/fnlm_denoised_lena_bgr.png", cv::IMREAD_COLOR);
......@@ -181,5 +179,4 @@ TEST_P(FastNonLocalMeans, Regression)
INSTANTIATE_TEST_CASE_P(GPU_Denoising, FastNonLocalMeans, ALL_DEVICES);
#endif // HAVE_CUDA
This diff is collapsed.
......@@ -43,27 +43,30 @@
#ifdef HAVE_CUDA
namespace {
IMPLEMENT_PARAM_CLASS(KSize, cv::Size)
cv::Mat getInnerROI(cv::InputArray m_, cv::Size ksize)
namespace
{
cv::Mat m = getMat(m_);
cv::Rect roi(ksize.width, ksize.height, m.cols - 2 * ksize.width, m.rows - 2 * ksize.height);
return m(roi);
}
IMPLEMENT_PARAM_CLASS(KSize, cv::Size)
IMPLEMENT_PARAM_CLASS(Anchor, cv::Point)
IMPLEMENT_PARAM_CLASS(Deriv_X, int)
IMPLEMENT_PARAM_CLASS(Deriv_Y, int)
IMPLEMENT_PARAM_CLASS(Iterations, int)
cv::Mat getInnerROI(cv::InputArray m, int ksize)
{
return getInnerROI(m, cv::Size(ksize, ksize));
cv::Mat getInnerROI(cv::InputArray m_, cv::Size ksize)
{
cv::Mat m = getMat(m_);
cv::Rect roi(ksize.width, ksize.height, m.cols - 2 * ksize.width, m.rows - 2 * ksize.height);
return m(roi);
}
cv::Mat getInnerROI(cv::InputArray m, int ksize)
{
return getInnerROI(m, cv::Size(ksize, ksize));
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
// Blur
IMPLEMENT_PARAM_CLASS(Anchor, cv::Point)
PARAM_TEST_CASE(Blur, cv::gpu::DeviceInfo, cv::Size, MatType, KSize, Anchor, UseRoi)
{
cv::gpu::DeviceInfo devInfo;
......@@ -86,7 +89,7 @@ PARAM_TEST_CASE(Blur, cv::gpu::DeviceInfo, cv::Size, MatType, KSize, Anchor, Use
}
};
TEST_P(Blur, Accuracy)
GPU_TEST_P(Blur, Accuracy)
{
cv::Mat src = randomMat(size, type);
......@@ -110,9 +113,6 @@ INSTANTIATE_TEST_CASE_P(GPU_Filter, Blur, testing::Combine(
/////////////////////////////////////////////////////////////////////////////////////////////////
// Sobel
IMPLEMENT_PARAM_CLASS(Deriv_X, int)
IMPLEMENT_PARAM_CLASS(Deriv_Y, int)
PARAM_TEST_CASE(Sobel, cv::gpu::DeviceInfo, cv::Size, MatDepth, Channels, KSize, Deriv_X, Deriv_Y, BorderType, UseRoi)
{
cv::gpu::DeviceInfo devInfo;
......@@ -145,7 +145,7 @@ PARAM_TEST_CASE(Sobel, cv::gpu::DeviceInfo, cv::Size, MatDepth, Channels, KSize,
}
};
TEST_P(Sobel, Accuracy)
GPU_TEST_P(Sobel, Accuracy)
{
if (dx == 0 && dy == 0)
return;
......@@ -208,7 +208,7 @@ PARAM_TEST_CASE(Scharr, cv::gpu::DeviceInfo, cv::Size, MatDepth, Channels, Deriv
}
};
TEST_P(Scharr, Accuracy)
GPU_TEST_P(Scharr, Accuracy)
{
if (dx + dy != 1)
return;
......@@ -268,7 +268,7 @@ PARAM_TEST_CASE(GaussianBlur, cv::gpu::DeviceInfo, cv::Size, MatDepth, Channels,
}
};
TEST_P(GaussianBlur, Accuracy)
GPU_TEST_P(GaussianBlur, Accuracy)
{
cv::Mat src = randomMat(size, type);
double sigma1 = randomDouble(0.1, 1.0);
......@@ -347,7 +347,7 @@ PARAM_TEST_CASE(Laplacian, cv::gpu::DeviceInfo, cv::Size, MatType, KSize, UseRoi
}
};
TEST_P(Laplacian, Accuracy)
GPU_TEST_P(Laplacian, Accuracy)
{
cv::Mat src = randomMat(size, type);
......@@ -370,8 +370,6 @@ INSTANTIATE_TEST_CASE_P(GPU_Filter, Laplacian, testing::Combine(
/////////////////////////////////////////////////////////////////////////////////////////////////
// Erode
IMPLEMENT_PARAM_CLASS(Iterations, int)
PARAM_TEST_CASE(Erode, cv::gpu::DeviceInfo, cv::Size, MatType, Anchor, Iterations, UseRoi)
{
cv::gpu::DeviceInfo devInfo;
......@@ -394,7 +392,7 @@ PARAM_TEST_CASE(Erode, cv::gpu::DeviceInfo, cv::Size, MatType, Anchor, Iteration
}
};
TEST_P(Erode, Accuracy)
GPU_TEST_P(Erode, Accuracy)
{
cv::Mat src = randomMat(size, type);
cv::Mat kernel = cv::Mat::ones(3, 3, CV_8U);
......@@ -443,7 +441,7 @@ PARAM_TEST_CASE(Dilate, cv::gpu::DeviceInfo, cv::Size, MatType, Anchor, Iteratio
}
};
TEST_P(Dilate, Accuracy)
GPU_TEST_P(Dilate, Accuracy)
{
cv::Mat src = randomMat(size, type);
cv::Mat kernel = cv::Mat::ones(3, 3, CV_8U);
......@@ -497,7 +495,7 @@ PARAM_TEST_CASE(MorphEx, cv::gpu::DeviceInfo, cv::Size, MatType, MorphOp, Anchor
}
};
TEST_P(MorphEx, Accuracy)
GPU_TEST_P(MorphEx, Accuracy)
{
cv::Mat src = randomMat(size, type);
cv::Mat kernel = cv::Mat::ones(3, 3, CV_8U);
......@@ -551,7 +549,7 @@ PARAM_TEST_CASE(Filter2D, cv::gpu::DeviceInfo, cv::Size, MatType, KSize, Anchor,
}
};
TEST_P(Filter2D, Accuracy)
GPU_TEST_P(Filter2D, Accuracy)
{
cv::Mat src = randomMat(size, type);
cv::Mat kernel = randomMat(cv::Size(ksize.width, ksize.height), CV_32FC1, 0.0, 1.0);
......@@ -574,6 +572,4 @@ INSTANTIATE_TEST_CASE_P(GPU_Filter, Filter2D, testing::Combine(
testing::Values(BorderType(cv::BORDER_REFLECT101), BorderType(cv::BORDER_REPLICATE), BorderType(cv::BORDER_CONSTANT), BorderType(cv::BORDER_REFLECT)),
WHOLE_SUBMAT));
} // namespace
#endif // HAVE_CUDA
......@@ -51,7 +51,7 @@ struct CompactPoints : testing::TestWithParam<gpu::DeviceInfo>
virtual void SetUp() { gpu::setDevice(GetParam().deviceID()); }
};
TEST_P(CompactPoints, CanCompactizeSmallInput)
GPU_TEST_P(CompactPoints, CanCompactizeSmallInput)
{
Mat src0(1, 3, CV_32FC2);
src0.at<Point2f>(0,0) = Point2f(0,0);
......
......@@ -44,8 +44,6 @@
#ifdef HAVE_CUDA
namespace {
////////////////////////////////////////////////////////////////////////////////
// SetTo
......@@ -67,7 +65,7 @@ PARAM_TEST_CASE(SetTo, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
}
};
TEST_P(SetTo, Zero)
GPU_TEST_P(SetTo, Zero)
{
cv::Scalar zero = cv::Scalar::all(0);
......@@ -77,7 +75,7 @@ TEST_P(SetTo, Zero)
EXPECT_MAT_NEAR(cv::Mat::zeros(size, type), mat, 0.0);
}
TEST_P(SetTo, SameVal)
GPU_TEST_P(SetTo, SameVal)
{
cv::Scalar val = cv::Scalar::all(randomDouble(0.0, 255.0));
......@@ -102,7 +100,7 @@ TEST_P(SetTo, SameVal)
}
}
TEST_P(SetTo, DifferentVal)
GPU_TEST_P(SetTo, DifferentVal)
{
cv::Scalar val = randomScalar(0.0, 255.0);
......@@ -127,7 +125,7 @@ TEST_P(SetTo, DifferentVal)
}
}
TEST_P(SetTo, Masked)
GPU_TEST_P(SetTo, Masked)
{
cv::Scalar val = randomScalar(0.0, 255.0);
cv::Mat mat_gold = randomMat(size, type);
......@@ -184,7 +182,7 @@ PARAM_TEST_CASE(CopyTo, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
}
};
TEST_P(CopyTo, WithOutMask)
GPU_TEST_P(CopyTo, WithOutMask)
{
cv::Mat src = randomMat(size, type);
......@@ -195,7 +193,7 @@ TEST_P(CopyTo, WithOutMask)
EXPECT_MAT_NEAR(src, dst, 0.0);
}
TEST_P(CopyTo, Masked)
GPU_TEST_P(CopyTo, Masked)
{
cv::Mat src = randomMat(size, type);
cv::Mat mask = randomMat(size, CV_8UC1, 0.0, 2.0);
......@@ -255,7 +253,7 @@ PARAM_TEST_CASE(ConvertTo, cv::gpu::DeviceInfo, cv::Size, MatDepth, MatDepth, Us
}
};
TEST_P(ConvertTo, WithOutScaling)
GPU_TEST_P(ConvertTo, WithOutScaling)
{
cv::Mat src = randomMat(size, depth1);
......@@ -285,7 +283,7 @@ TEST_P(ConvertTo, WithOutScaling)
}
}
TEST_P(ConvertTo, WithScaling)
GPU_TEST_P(ConvertTo, WithScaling)
{
cv::Mat src = randomMat(size, depth1);
double a = randomDouble(0.0, 1.0);
......@@ -336,7 +334,7 @@ struct EnsureSizeIsEnough : testing::TestWithParam<cv::gpu::DeviceInfo>
}
};
TEST_P(EnsureSizeIsEnough, BufferReuse)
GPU_TEST_P(EnsureSizeIsEnough, BufferReuse)
{
cv::gpu::GpuMat buffer(100, 100, CV_8U);
cv::gpu::GpuMat old = buffer;
......@@ -358,6 +356,4 @@ TEST_P(EnsureSizeIsEnough, BufferReuse)
INSTANTIATE_TEST_CASE_P(GPU_GpuMat, EnsureSizeIsEnough, ALL_DEVICES);
} // namespace
#endif // HAVE_CUDA
......@@ -43,8 +43,6 @@
#ifdef HAVE_CUDA
namespace {
///////////////////////////////////////////////////////////////////////////////////////////////////////
// HoughLines
......@@ -79,7 +77,7 @@ PARAM_TEST_CASE(HoughLines, cv::gpu::DeviceInfo, cv::Size, UseRoi)
}
};
TEST_P(HoughLines, Accuracy)
GPU_TEST_P(HoughLines, Accuracy)
{
const cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
......@@ -88,7 +86,7 @@ TEST_P(HoughLines, Accuracy)
const float rho = 1.0f;
const float theta = (float) (1.5 * CV_PI / 180.0);
onst int threshold = 100;
const int threshold = 100;
cv::Mat src(size, CV_8UC1);
generateLines(src);
......@@ -124,7 +122,7 @@ PARAM_TEST_CASE(HoughCircles, cv::gpu::DeviceInfo, cv::Size, UseRoi)
}
};
TEST_P(HoughCircles, Accuracy)
GPU_TEST_P(HoughCircles, Accuracy)
{
const cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
......@@ -188,7 +186,7 @@ PARAM_TEST_CASE(GeneralizedHough, cv::gpu::DeviceInfo, UseRoi)
{
};
TEST_P(GeneralizedHough, POSITION)
GPU_TEST_P(GeneralizedHough, POSITION)
{
const cv::gpu::DeviceInfo devInfo = GET_PARAM(0);
cv::gpu::setDevice(devInfo.deviceID());
......@@ -251,6 +249,4 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, GeneralizedHough, testing::Combine(
ALL_DEVICES,
WHOLE_SUBMAT));
} // namespace
#endif // HAVE_CUDA
This diff is collapsed.
......@@ -43,8 +43,8 @@
#ifdef HAVE_CUDA
namespace {
namespace
{
struct GreedyLabeling
{
struct dot
......@@ -166,7 +166,7 @@ struct Labeling : testing::TestWithParam<cv::gpu::DeviceInfo>
}
};
TEST_P(Labeling, ConnectedComponents)
GPU_TEST_P(Labeling, ConnectedComponents)
{
cv::Mat image;
cvtColor(loat_image(), image, CV_BGR2GRAY);
......@@ -191,6 +191,6 @@ TEST_P(Labeling, ConnectedComponents)
host.checkCorrectness(cv::Mat(components));
}
INSTANTIATE_TEST_CASE_P(ConnectedComponents, Labeling, ALL_DEVICES);
INSTANTIATE_TEST_CASE_P(GPU_ConnectedComponents, Labeling, ALL_DEVICES);
#endif // HAVE_CUDA
......@@ -41,11 +41,9 @@
#include "test_precomp.hpp"
#if defined HAVE_CUDA
OutputLevel nvidiaTestOutputLevel = OutputLevelNone;
#endif
#ifdef HAVE_CUDA
#if defined HAVE_CUDA && !defined(CUDA_DISABLER)
OutputLevel nvidiaTestOutputLevel = OutputLevelNone;
using namespace cvtest;
using namespace testing;
......@@ -69,77 +67,77 @@ struct NVidiaTest : TestWithParam<cv::gpu::DeviceInfo>
struct NPPST : NVidiaTest {};
struct NCV : NVidiaTest {};
//TEST_P(NPPST, Integral)
//{
// bool res = nvidia_NPPST_Integral_Image(path, nvidiaTestOutputLevel);
GPU_TEST_P(NPPST, Integral)
{
bool res = nvidia_NPPST_Integral_Image(_path, nvidiaTestOutputLevel);
// ASSERT_TRUE(res);
//}
ASSERT_TRUE(res);
}
TEST_P(NPPST, SquaredIntegral)
GPU_TEST_P(NPPST, SquaredIntegral)
{
bool res = nvidia_NPPST_Squared_Integral_Image(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NPPST, RectStdDev)
GPU_TEST_P(NPPST, RectStdDev)
{
bool res = nvidia_NPPST_RectStdDev(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NPPST, Resize)
GPU_TEST_P(NPPST, Resize)
{
bool res = nvidia_NPPST_Resize(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NPPST, VectorOperations)
GPU_TEST_P(NPPST, VectorOperations)
{
bool res = nvidia_NPPST_Vector_Operations(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NPPST, Transpose)
GPU_TEST_P(NPPST, Transpose)
{
bool res = nvidia_NPPST_Transpose(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NCV, VectorOperations)
GPU_TEST_P(NCV, VectorOperations)
{
bool res = nvidia_NCV_Vector_Operations(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NCV, HaarCascadeLoader)
GPU_TEST_P(NCV, HaarCascadeLoader)
{
bool res = nvidia_NCV_Haar_Cascade_Loader(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NCV, HaarCascadeApplication)
GPU_TEST_P(NCV, HaarCascadeApplication)
{
bool res = nvidia_NCV_Haar_Cascade_Application(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NCV, HypothesesFiltration)
GPU_TEST_P(NCV, HypothesesFiltration)
{
bool res = nvidia_NCV_Hypotheses_Filtration(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NCV, Visualization)
GPU_TEST_P(NCV, Visualization)
{
// this functionality doesn't used in gpu module
bool res = nvidia_NCV_Visualization(_path, nvidiaTestOutputLevel);
......
......@@ -43,8 +43,6 @@
#ifdef HAVE_CUDA
namespace {
//#define DUMP
struct HOG : testing::TestWithParam<cv::gpu::DeviceInfo>, cv::gpu::HOGDescriptor
......@@ -176,7 +174,7 @@ struct HOG : testing::TestWithParam<cv::gpu::DeviceInfo>, cv::gpu::HOGDescriptor
};
// desabled while resize does not fixed
TEST_P(HOG, DISABLED_Detect)
GPU_TEST_P(HOG, Detect)
{
cv::Mat img_rgb = readImage("hog/road.png");
ASSERT_FALSE(img_rgb.empty());
......@@ -201,7 +199,7 @@ TEST_P(HOG, DISABLED_Detect)
f.close();
}
TEST_P(HOG, GetDescriptors)
GPU_TEST_P(HOG, GetDescriptors)
{
// Load image (e.g. train data, composed from windows)
cv::Mat img_rgb = readImage("hog/train_data.png");
......@@ -288,6 +286,7 @@ TEST_P(HOG, GetDescriptors)
INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, HOG, ALL_DEVICES);
//============== caltech hog tests =====================//
struct CalTech : public ::testing::TestWithParam<std::tr1::tuple<cv::gpu::DeviceInfo, std::string> >
{
cv::gpu::DeviceInfo devInfo;
......@@ -303,7 +302,7 @@ struct CalTech : public ::testing::TestWithParam<std::tr1::tuple<cv::gpu::Device
}
};
TEST_P(CalTech, HOG)
GPU_TEST_P(CalTech, HOG)
{
cv::gpu::GpuMat d_img(img);
cv::Mat markedImage(img.clone());
......@@ -350,7 +349,7 @@ PARAM_TEST_CASE(LBP_Read_classifier, cv::gpu::DeviceInfo, int)
}
};
TEST_P(LBP_Read_classifier, Accuracy)
GPU_TEST_P(LBP_Read_classifier, Accuracy)
{
cv::gpu::CascadeClassifier_GPU classifier;
std::string classifierXmlPath = std::string(cvtest::TS::ptr()->get_data_path()) + "lbpcascade/lbpcascade_frontalface.xml";
......@@ -372,7 +371,7 @@ PARAM_TEST_CASE(LBP_classify, cv::gpu::DeviceInfo, int)
}
};
TEST_P(LBP_classify, Accuracy)
GPU_TEST_P(LBP_classify, Accuracy)
{
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";
......@@ -422,6 +421,4 @@ TEST_P(LBP_classify, Accuracy)
INSTANTIATE_TEST_CASE_P(GPU_ObjDetect, LBP_classify,
testing::Combine(ALL_DEVICES, testing::Values<int>(0)));
} // namespace
#endif // HAVE_CUDA
......@@ -68,7 +68,7 @@ PARAM_TEST_CASE(GlBuffer, cv::Size, MatType)
}
};
TEST_P(GlBuffer, Constructor1)
GPU_TEST_P(GlBuffer, Constructor1)
{
cv::GlBuffer buf(size.height, size.width, type, cv::GlBuffer::ARRAY_BUFFER, true);
......@@ -77,7 +77,7 @@ TEST_P(GlBuffer, Constructor1)
EXPECT_EQ(type, buf.type());
}
TEST_P(GlBuffer, Constructor2)
GPU_TEST_P(GlBuffer, Constructor2)
{
cv::GlBuffer buf(size, type, cv::GlBuffer::ARRAY_BUFFER, true);
......@@ -86,7 +86,7 @@ TEST_P(GlBuffer, Constructor2)
EXPECT_EQ(type, buf.type());
}
TEST_P(GlBuffer, ConstructorFromMat)
GPU_TEST_P(GlBuffer, ConstructorFromMat)
{
cv::Mat gold = randomMat(size, type);
......@@ -98,7 +98,7 @@ TEST_P(GlBuffer, ConstructorFromMat)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
TEST_P(GlBuffer, ConstructorFromGpuMat)
GPU_TEST_P(GlBuffer, ConstructorFromGpuMat)
{
cv::Mat gold = randomMat(size, type);
cv::gpu::GpuMat d_gold(gold);
......@@ -111,7 +111,7 @@ TEST_P(GlBuffer, ConstructorFromGpuMat)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
TEST_P(GlBuffer, ConstructorFromGlBuffer)
GPU_TEST_P(GlBuffer, ConstructorFromGlBuffer)
{
cv::GlBuffer buf_gold(size, type, cv::GlBuffer::ARRAY_BUFFER, true);
......@@ -123,7 +123,7 @@ TEST_P(GlBuffer, ConstructorFromGlBuffer)
EXPECT_EQ(buf_gold.type(), buf.type());
}
TEST_P(GlBuffer, ConstructorFromGlTexture2D)
GPU_TEST_P(GlBuffer, ConstructorFromGlTexture2D)
{
const int depth = CV_MAT_DEPTH(type);
const int cn = CV_MAT_CN(type);
......@@ -142,7 +142,7 @@ TEST_P(GlBuffer, ConstructorFromGlTexture2D)
EXPECT_MAT_NEAR(gold, bufData, 1e-2);
}
TEST_P(GlBuffer, Create)
GPU_TEST_P(GlBuffer, Create)
{
cv::GlBuffer buf;
buf.create(size.height, size.width, type, cv::GlBuffer::ARRAY_BUFFER, true);
......@@ -152,7 +152,7 @@ TEST_P(GlBuffer, Create)
EXPECT_EQ(type, buf.type());
}
TEST_P(GlBuffer, CopyFromMat)
GPU_TEST_P(GlBuffer, CopyFromMat)
{
cv::Mat gold = randomMat(size, type);
......@@ -165,7 +165,7 @@ TEST_P(GlBuffer, CopyFromMat)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
TEST_P(GlBuffer, CopyFromGpuMat)
GPU_TEST_P(GlBuffer, CopyFromGpuMat)
{
cv::Mat gold = randomMat(size, type);
cv::gpu::GpuMat d_gold(gold);
......@@ -179,7 +179,7 @@ TEST_P(GlBuffer, CopyFromGpuMat)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
TEST_P(GlBuffer, CopyFromGlBuffer)
GPU_TEST_P(GlBuffer, CopyFromGlBuffer)
{
cv::Mat gold = randomMat(size, type);
cv::GlBuffer buf_gold(gold, cv::GlBuffer::ARRAY_BUFFER, true);
......@@ -195,7 +195,7 @@ TEST_P(GlBuffer, CopyFromGlBuffer)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
TEST_P(GlBuffer, CopyFromGlTexture2D)
GPU_TEST_P(GlBuffer, CopyFromGlTexture2D)
{
const int depth = CV_MAT_DEPTH(type);
const int cn = CV_MAT_CN(type);
......@@ -215,7 +215,7 @@ TEST_P(GlBuffer, CopyFromGlTexture2D)
EXPECT_MAT_NEAR(gold, bufData, 1e-2);
}
TEST_P(GlBuffer, CopyToGpuMat)
GPU_TEST_P(GlBuffer, CopyToGpuMat)
{
cv::Mat gold = randomMat(size, type);
......@@ -227,7 +227,7 @@ TEST_P(GlBuffer, CopyToGpuMat)
EXPECT_MAT_NEAR(gold, dst, 0);
}
TEST_P(GlBuffer, CopyToGlBuffer)
GPU_TEST_P(GlBuffer, CopyToGlBuffer)
{
cv::Mat gold = randomMat(size, type);
......@@ -244,7 +244,7 @@ TEST_P(GlBuffer, CopyToGlBuffer)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
TEST_P(GlBuffer, CopyToGlTexture2D)
GPU_TEST_P(GlBuffer, CopyToGlTexture2D)
{
const int depth = CV_MAT_DEPTH(type);
const int cn = CV_MAT_CN(type);
......@@ -265,7 +265,7 @@ TEST_P(GlBuffer, CopyToGlTexture2D)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
TEST_P(GlBuffer, Clone)
GPU_TEST_P(GlBuffer, Clone)
{
cv::Mat gold = randomMat(size, type);
......@@ -281,7 +281,7 @@ TEST_P(GlBuffer, Clone)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
TEST_P(GlBuffer, MapHostRead)
GPU_TEST_P(GlBuffer, MapHostRead)
{
cv::Mat gold = randomMat(size, type);
......@@ -294,7 +294,7 @@ TEST_P(GlBuffer, MapHostRead)
buf.unmapHost();
}
TEST_P(GlBuffer, MapHostWrite)
GPU_TEST_P(GlBuffer, MapHostWrite)
{
cv::Mat gold = randomMat(size, type);
......@@ -311,7 +311,7 @@ TEST_P(GlBuffer, MapHostWrite)
EXPECT_MAT_NEAR(gold, bufData, 0);
}
TEST_P(GlBuffer, MapDevice)
GPU_TEST_P(GlBuffer, MapDevice)
{
cv::Mat gold = randomMat(size, type);
......@@ -358,7 +358,7 @@ PARAM_TEST_CASE(GlTexture2D, cv::Size, MatType)
}
};
TEST_P(GlTexture2D, Constructor1)
GPU_TEST_P(GlTexture2D, Constructor1)
{
cv::GlTexture2D tex(size.height, size.width, format, true);
......@@ -367,7 +367,7 @@ TEST_P(GlTexture2D, Constructor1)
EXPECT_EQ(format, tex.format());
}
TEST_P(GlTexture2D, Constructor2)
GPU_TEST_P(GlTexture2D, Constructor2)
{
cv::GlTexture2D tex(size, format, true);
......@@ -376,7 +376,7 @@ TEST_P(GlTexture2D, Constructor2)
EXPECT_EQ(format, tex.format());
}
TEST_P(GlTexture2D, ConstructorFromMat)
GPU_TEST_P(GlTexture2D, ConstructorFromMat)
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
......@@ -388,7 +388,7 @@ TEST_P(GlTexture2D, ConstructorFromMat)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
TEST_P(GlTexture2D, ConstructorFromGpuMat)
GPU_TEST_P(GlTexture2D, ConstructorFromGpuMat)
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
cv::gpu::GpuMat d_gold(gold);
......@@ -401,7 +401,7 @@ TEST_P(GlTexture2D, ConstructorFromGpuMat)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
TEST_P(GlTexture2D, ConstructorFromGlBuffer)
GPU_TEST_P(GlTexture2D, ConstructorFromGlBuffer)
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
cv::GlBuffer buf_gold(gold, cv::GlBuffer::PIXEL_UNPACK_BUFFER, true);
......@@ -414,7 +414,7 @@ TEST_P(GlTexture2D, ConstructorFromGlBuffer)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
TEST_P(GlTexture2D, ConstructorFromGlTexture2D)
GPU_TEST_P(GlTexture2D, ConstructorFromGlTexture2D)
{
cv::GlTexture2D tex_gold(size, format, true);
cv::GlTexture2D tex(tex_gold);
......@@ -425,7 +425,7 @@ TEST_P(GlTexture2D, ConstructorFromGlTexture2D)
EXPECT_EQ(tex_gold.format(), tex.format());
}
TEST_P(GlTexture2D, Create)
GPU_TEST_P(GlTexture2D, Create)
{
cv::GlTexture2D tex;
tex.create(size.height, size.width, format, true);
......@@ -435,7 +435,7 @@ TEST_P(GlTexture2D, Create)
EXPECT_EQ(format, tex.format());
}
TEST_P(GlTexture2D, CopyFromMat)
GPU_TEST_P(GlTexture2D, CopyFromMat)
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
......@@ -448,7 +448,7 @@ TEST_P(GlTexture2D, CopyFromMat)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
TEST_P(GlTexture2D, CopyFromGpuMat)
GPU_TEST_P(GlTexture2D, CopyFromGpuMat)
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
cv::gpu::GpuMat d_gold(gold);
......@@ -462,7 +462,7 @@ TEST_P(GlTexture2D, CopyFromGpuMat)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
TEST_P(GlTexture2D, CopyFromGlBuffer)
GPU_TEST_P(GlTexture2D, CopyFromGlBuffer)
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
cv::GlBuffer buf_gold(gold, cv::GlBuffer::PIXEL_UNPACK_BUFFER, true);
......@@ -476,7 +476,7 @@ TEST_P(GlTexture2D, CopyFromGlBuffer)
EXPECT_MAT_NEAR(gold, texData, 1e-2);
}
TEST_P(GlTexture2D, CopyToGpuMat)
GPU_TEST_P(GlTexture2D, CopyToGpuMat)
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
......@@ -488,7 +488,7 @@ TEST_P(GlTexture2D, CopyToGpuMat)
EXPECT_MAT_NEAR(gold, dst, 1e-2);
}
TEST_P(GlTexture2D, CopyToGlBuffer)
GPU_TEST_P(GlTexture2D, CopyToGlBuffer)
{
cv::Mat gold = randomMat(size, type, 0, depth == CV_8U ? 255 : 1);
......
This diff is collapsed.
......@@ -51,6 +51,7 @@
#define __OPENCV_TEST_PRECOMP_HPP__
#include <cmath>
#include <ctime>
#include <cstdio>
#include <iostream>
#include <fstream>
......
......@@ -64,7 +64,7 @@ PARAM_TEST_CASE(PyrDown, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
}
};
TEST_P(PyrDown, Accuracy)
GPU_TEST_P(PyrDown, Accuracy)
{
cv::Mat src = randomMat(size, type);
......@@ -104,7 +104,7 @@ PARAM_TEST_CASE(PyrUp, cv::gpu::DeviceInfo, cv::Size, MatType, UseRoi)
}
};
TEST_P(PyrUp, Accuracy)
GPU_TEST_P(PyrUp, Accuracy)
{
cv::Mat src = randomMat(size, type);
......
......@@ -152,7 +152,7 @@ PARAM_TEST_CASE(Remap, cv::gpu::DeviceInfo, cv::Size, MatType, Interpolation, Bo
}
};
TEST_P(Remap, Accuracy)
GPU_TEST_P(Remap, Accuracy)
{
cv::Mat src = randomMat(size, type);
cv::Scalar val = randomScalar(0.0, 255.0);
......
......@@ -136,7 +136,7 @@ PARAM_TEST_CASE(Resize, cv::gpu::DeviceInfo, cv::Size, MatType, double, Interpol
}
};
TEST_P(Resize, Accuracy)
GPU_TEST_P(Resize, Accuracy)
{
cv::Mat src = randomMat(size, type);
......@@ -157,8 +157,8 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, Resize, testing::Combine(
testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)),
WHOLE_SUBMAT));
/////////////////
PARAM_TEST_CASE(ResizeSameAsHost, cv::gpu::DeviceInfo, cv::Size, MatType, double, Interpolation, UseRoi)
{
cv::gpu::DeviceInfo devInfo;
......@@ -182,7 +182,7 @@ PARAM_TEST_CASE(ResizeSameAsHost, cv::gpu::DeviceInfo, cv::Size, MatType, double
};
// downscaling only: used for classifiers
TEST_P(ResizeSameAsHost, Accuracy)
GPU_TEST_P(ResizeSameAsHost, Accuracy)
{
cv::Mat src = randomMat(size, type);
......@@ -224,7 +224,7 @@ PARAM_TEST_CASE(ResizeNPP, cv::gpu::DeviceInfo, MatType, double, Interpolation)
}
};
TEST_P(ResizeNPP, Accuracy)
GPU_TEST_P(ResizeNPP, Accuracy)
{
cv::Mat src = readImageType("stereobp/aloe-L.png", type);
ASSERT_FALSE(src.empty());
......
This diff is collapsed.
......@@ -66,7 +66,7 @@ PARAM_TEST_CASE(Threshold, cv::gpu::DeviceInfo, cv::Size, MatType, ThreshOp, Use
}
};
TEST_P(Threshold, Accuracy)
GPU_TEST_P(Threshold, Accuracy)
{
cv::Mat src = randomMat(size, type);
double maxVal = randomDouble(20.0, 127.0);
......
This diff is collapsed.
......@@ -48,6 +48,7 @@ namespace
cv::Mat createTransfomMatrix(cv::Size srcSize, double angle)
{
cv::Mat M(2, 3, CV_64FC1);
M.at<double>(0, 0) = std::cos(angle); M.at<double>(0, 1) = -std::sin(angle); M.at<double>(0, 2) = srcSize.width / 2;
M.at<double>(1, 0) = std::sin(angle); M.at<double>(1, 1) = std::cos(angle); M.at<double>(1, 2) = 0.0;
......@@ -74,22 +75,23 @@ PARAM_TEST_CASE(BuildWarpAffineMaps, cv::gpu::DeviceInfo, cv::Size, Inverse)
}
};
TEST_P(BuildWarpAffineMaps, Accuracy)
GPU_TEST_P(BuildWarpAffineMaps, Accuracy)
{
cv::Mat M = createTransfomMatrix(size, CV_PI / 4);
cv::Mat src = randomMat(randomSize(200, 400), CV_8UC1);
cv::gpu::GpuMat xmap, ymap;
cv::gpu::buildWarpAffineMaps(M, inverse, size, xmap, ymap);
int interpolation = cv::INTER_NEAREST;
int borderMode = cv::BORDER_CONSTANT;
int flags = interpolation;
if (inverse)
flags |= cv::WARP_INVERSE_MAP;
cv::Mat src = randomMat(randomSize(200, 400), CV_8UC1);
cv::Mat dst;
cv::remap(src, dst, cv::Mat(xmap), cv::Mat(ymap), interpolation, borderMode);
int flags = interpolation;
if (inverse)
flags |= cv::WARP_INVERSE_MAP;
cv::Mat dst_gold;
cv::warpAffine(src, dst_gold, M, size, flags, borderMode);
......@@ -199,7 +201,7 @@ PARAM_TEST_CASE(WarpAffine, cv::gpu::DeviceInfo, cv::Size, MatType, Inverse, Int
}
};
TEST_P(WarpAffine, Accuracy)
GPU_TEST_P(WarpAffine, Accuracy)
{
cv::Mat src = randomMat(size, type);
cv::Mat M = createTransfomMatrix(size, CV_PI / 3);
......@@ -247,7 +249,7 @@ PARAM_TEST_CASE(WarpAffineNPP, cv::gpu::DeviceInfo, MatType, Inverse, Interpolat
}
};
TEST_P(WarpAffineNPP, Accuracy)
GPU_TEST_P(WarpAffineNPP, Accuracy)
{
cv::Mat src = readImageType("stereobp/aloe-L.png", type);
cv::Mat M = createTransfomMatrix(src.size(), CV_PI / 4);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment