mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
replaced GPU -> CUDA
This commit is contained in:
@@ -92,9 +92,9 @@ void generateMap(cv::Mat& map_x, cv::Mat& map_y, int remapMode)
|
||||
DEF_PARAM_TEST(Sz_Depth_Cn_Inter_Border_Mode, cv::Size, MatDepth, MatCn, Interpolation, BorderMode, RemapMode);
|
||||
|
||||
PERF_TEST_P(Sz_Depth_Cn_Inter_Border_Mode, Remap,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16U, CV_32F),
|
||||
GPU_CHANNELS_1_3_4,
|
||||
CUDA_CHANNELS_1_3_4,
|
||||
Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)),
|
||||
ALL_BORDER_MODES,
|
||||
RemapMode::all()))
|
||||
@@ -117,7 +117,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border_Mode, Remap,
|
||||
cv::Mat ymap(size, CV_32FC1);
|
||||
generateMap(xmap, ymap, remapMode);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
const cv::cuda::GpuMat d_xmap(xmap);
|
||||
@@ -126,7 +126,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border_Mode, Remap,
|
||||
|
||||
TEST_CYCLE() cv::cuda::remap(d_src, dst, d_xmap, d_ymap, interpolation, borderMode);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -144,9 +144,9 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border_Mode, Remap,
|
||||
DEF_PARAM_TEST(Sz_Depth_Cn_Inter_Scale, cv::Size, MatDepth, MatCn, Interpolation, double);
|
||||
|
||||
PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, Resize,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16U, CV_32F),
|
||||
GPU_CHANNELS_1_3_4,
|
||||
CUDA_CHANNELS_1_3_4,
|
||||
Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)),
|
||||
Values(0.5, 0.3, 2.0)))
|
||||
{
|
||||
@@ -163,14 +163,14 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, Resize,
|
||||
cv::Mat src(size, type);
|
||||
declare.in(src, WARMUP_RNG);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
|
||||
TEST_CYCLE() cv::cuda::resize(d_src, dst, cv::Size(), f, f, interpolation);
|
||||
|
||||
GPU_SANITY_CHECK(dst, 1e-3, ERROR_RELATIVE);
|
||||
CUDA_SANITY_CHECK(dst, 1e-3, ERROR_RELATIVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -188,9 +188,9 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, Resize,
|
||||
DEF_PARAM_TEST(Sz_Depth_Cn_Scale, cv::Size, MatDepth, MatCn, double);
|
||||
|
||||
PERF_TEST_P(Sz_Depth_Cn_Scale, ResizeArea,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16U, CV_32F),
|
||||
GPU_CHANNELS_1_3_4,
|
||||
CUDA_CHANNELS_1_3_4,
|
||||
Values(0.2, 0.1, 0.05)))
|
||||
{
|
||||
declare.time(1.0);
|
||||
@@ -206,14 +206,14 @@ PERF_TEST_P(Sz_Depth_Cn_Scale, ResizeArea,
|
||||
cv::Mat src(size, type);
|
||||
declare.in(src, WARMUP_RNG);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
|
||||
TEST_CYCLE() cv::cuda::resize(d_src, dst, cv::Size(), f, f, interpolation);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -231,9 +231,9 @@ PERF_TEST_P(Sz_Depth_Cn_Scale, ResizeArea,
|
||||
DEF_PARAM_TEST(Sz_Depth_Cn_Inter_Border, cv::Size, MatDepth, MatCn, Interpolation, BorderMode);
|
||||
|
||||
PERF_TEST_P(Sz_Depth_Cn_Inter_Border, WarpAffine,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16U, CV_32F),
|
||||
GPU_CHANNELS_1_3_4,
|
||||
CUDA_CHANNELS_1_3_4,
|
||||
Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)),
|
||||
ALL_BORDER_MODES))
|
||||
{
|
||||
@@ -258,14 +258,14 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, WarpAffine,
|
||||
};
|
||||
const cv::Mat M(2, 3, CV_64F, (void*) mat);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
|
||||
TEST_CYCLE() cv::cuda::warpAffine(d_src, dst, M, size, interpolation, borderMode);
|
||||
|
||||
GPU_SANITY_CHECK(dst, 1);
|
||||
CUDA_SANITY_CHECK(dst, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -281,9 +281,9 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, WarpAffine,
|
||||
// WarpPerspective
|
||||
|
||||
PERF_TEST_P(Sz_Depth_Cn_Inter_Border, WarpPerspective,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16U, CV_32F),
|
||||
GPU_CHANNELS_1_3_4,
|
||||
CUDA_CHANNELS_1_3_4,
|
||||
Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)),
|
||||
ALL_BORDER_MODES))
|
||||
{
|
||||
@@ -306,14 +306,14 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, WarpPerspective,
|
||||
{0.0, 0.0, 1.0}};
|
||||
const cv::Mat M(3, 3, CV_64F, (void*) mat);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
|
||||
TEST_CYCLE() cv::cuda::warpPerspective(d_src, dst, M, size, interpolation, borderMode);
|
||||
|
||||
GPU_SANITY_CHECK(dst, 1);
|
||||
CUDA_SANITY_CHECK(dst, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -329,7 +329,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, WarpPerspective,
|
||||
// BuildWarpPlaneMaps
|
||||
|
||||
PERF_TEST_P(Sz, BuildWarpPlaneMaps,
|
||||
GPU_TYPICAL_MAT_SIZES)
|
||||
CUDA_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
const cv::Size size = GetParam();
|
||||
|
||||
@@ -337,15 +337,15 @@ PERF_TEST_P(Sz, BuildWarpPlaneMaps,
|
||||
const cv::Mat R = cv::Mat::ones(3, 3, CV_32FC1);
|
||||
const cv::Mat T = cv::Mat::zeros(1, 3, CV_32F);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
cv::cuda::GpuMat map_x;
|
||||
cv::cuda::GpuMat map_y;
|
||||
|
||||
TEST_CYCLE() cv::cuda::buildWarpPlaneMaps(size, cv::Rect(0, 0, size.width, size.height), K, R, T, 1.0, map_x, map_y);
|
||||
|
||||
GPU_SANITY_CHECK(map_x);
|
||||
GPU_SANITY_CHECK(map_y);
|
||||
CUDA_SANITY_CHECK(map_x);
|
||||
CUDA_SANITY_CHECK(map_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -357,22 +357,22 @@ PERF_TEST_P(Sz, BuildWarpPlaneMaps,
|
||||
// BuildWarpCylindricalMaps
|
||||
|
||||
PERF_TEST_P(Sz, BuildWarpCylindricalMaps,
|
||||
GPU_TYPICAL_MAT_SIZES)
|
||||
CUDA_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
const cv::Size size = GetParam();
|
||||
|
||||
const cv::Mat K = cv::Mat::eye(3, 3, CV_32FC1);
|
||||
const cv::Mat R = cv::Mat::ones(3, 3, CV_32FC1);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
cv::cuda::GpuMat map_x;
|
||||
cv::cuda::GpuMat map_y;
|
||||
|
||||
TEST_CYCLE() cv::cuda::buildWarpCylindricalMaps(size, cv::Rect(0, 0, size.width, size.height), K, R, 1.0, map_x, map_y);
|
||||
|
||||
GPU_SANITY_CHECK(map_x);
|
||||
GPU_SANITY_CHECK(map_y);
|
||||
CUDA_SANITY_CHECK(map_x);
|
||||
CUDA_SANITY_CHECK(map_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -384,22 +384,22 @@ PERF_TEST_P(Sz, BuildWarpCylindricalMaps,
|
||||
// BuildWarpSphericalMaps
|
||||
|
||||
PERF_TEST_P(Sz, BuildWarpSphericalMaps,
|
||||
GPU_TYPICAL_MAT_SIZES)
|
||||
CUDA_TYPICAL_MAT_SIZES)
|
||||
{
|
||||
const cv::Size size = GetParam();
|
||||
|
||||
const cv::Mat K = cv::Mat::eye(3, 3, CV_32FC1);
|
||||
const cv::Mat R = cv::Mat::ones(3, 3, CV_32FC1);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
cv::cuda::GpuMat map_x;
|
||||
cv::cuda::GpuMat map_y;
|
||||
|
||||
TEST_CYCLE() cv::cuda::buildWarpSphericalMaps(size, cv::Rect(0, 0, size.width, size.height), K, R, 1.0, map_x, map_y);
|
||||
|
||||
GPU_SANITY_CHECK(map_x);
|
||||
GPU_SANITY_CHECK(map_y);
|
||||
CUDA_SANITY_CHECK(map_x);
|
||||
CUDA_SANITY_CHECK(map_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -413,9 +413,9 @@ PERF_TEST_P(Sz, BuildWarpSphericalMaps,
|
||||
DEF_PARAM_TEST(Sz_Depth_Cn_Inter, cv::Size, MatDepth, MatCn, Interpolation);
|
||||
|
||||
PERF_TEST_P(Sz_Depth_Cn_Inter, Rotate,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16U, CV_32F),
|
||||
GPU_CHANNELS_1_3_4,
|
||||
CUDA_CHANNELS_1_3_4,
|
||||
Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC))))
|
||||
{
|
||||
const cv::Size size = GET_PARAM(0);
|
||||
@@ -428,14 +428,14 @@ PERF_TEST_P(Sz_Depth_Cn_Inter, Rotate,
|
||||
cv::Mat src(size, type);
|
||||
declare.in(src, WARMUP_RNG);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
|
||||
TEST_CYCLE() cv::cuda::rotate(d_src, dst, size, 30.0, 0, 0, interpolation);
|
||||
|
||||
GPU_SANITY_CHECK(dst, 1e-3, ERROR_RELATIVE);
|
||||
CUDA_SANITY_CHECK(dst, 1e-3, ERROR_RELATIVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -447,9 +447,9 @@ PERF_TEST_P(Sz_Depth_Cn_Inter, Rotate,
|
||||
// PyrDown
|
||||
|
||||
PERF_TEST_P(Sz_Depth_Cn, PyrDown,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16U, CV_32F),
|
||||
GPU_CHANNELS_1_3_4))
|
||||
CUDA_CHANNELS_1_3_4))
|
||||
{
|
||||
const cv::Size size = GET_PARAM(0);
|
||||
const int depth = GET_PARAM(1);
|
||||
@@ -460,14 +460,14 @@ PERF_TEST_P(Sz_Depth_Cn, PyrDown,
|
||||
cv::Mat src(size, type);
|
||||
declare.in(src, WARMUP_RNG);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
|
||||
TEST_CYCLE() cv::cuda::pyrDown(d_src, dst);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -483,9 +483,9 @@ PERF_TEST_P(Sz_Depth_Cn, PyrDown,
|
||||
// PyrUp
|
||||
|
||||
PERF_TEST_P(Sz_Depth_Cn, PyrUp,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16U, CV_32F),
|
||||
GPU_CHANNELS_1_3_4))
|
||||
CUDA_CHANNELS_1_3_4))
|
||||
{
|
||||
const cv::Size size = GET_PARAM(0);
|
||||
const int depth = GET_PARAM(1);
|
||||
@@ -496,14 +496,14 @@ PERF_TEST_P(Sz_Depth_Cn, PyrUp,
|
||||
cv::Mat src(size, type);
|
||||
declare.in(src, WARMUP_RNG);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
|
||||
TEST_CYCLE() cv::cuda::pyrUp(d_src, dst);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -519,9 +519,9 @@ PERF_TEST_P(Sz_Depth_Cn, PyrUp,
|
||||
// ImagePyramidGetLayer
|
||||
|
||||
PERF_TEST_P(Sz_Depth_Cn, ImagePyramidGetLayer,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16U, CV_32F),
|
||||
GPU_CHANNELS_1_3_4))
|
||||
CUDA_CHANNELS_1_3_4))
|
||||
{
|
||||
const cv::Size size = GET_PARAM(0);
|
||||
const int depth = GET_PARAM(1);
|
||||
@@ -535,7 +535,7 @@ PERF_TEST_P(Sz_Depth_Cn, ImagePyramidGetLayer,
|
||||
const int nLayers = 3;
|
||||
const cv::Size dstSize(size.width / 2 + 10, size.height / 2 + 10);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
@@ -544,7 +544,7 @@ PERF_TEST_P(Sz_Depth_Cn, ImagePyramidGetLayer,
|
||||
|
||||
TEST_CYCLE() d_pyr->getLayer(dst, dstSize);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace cv { namespace cuda { namespace device
|
||||
}
|
||||
};
|
||||
|
||||
#define OPENCV_GPU_IMPLEMENT_REMAP_TEX(type) \
|
||||
#define OPENCV_CUDA_IMPLEMENT_REMAP_TEX(type) \
|
||||
texture< type , cudaTextureType2D> tex_remap_ ## type (0, cudaFilterModePoint, cudaAddressModeClamp); \
|
||||
struct tex_remap_ ## type ## _reader \
|
||||
{ \
|
||||
@@ -165,31 +165,31 @@ namespace cv { namespace cuda { namespace device
|
||||
} \
|
||||
};
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_REMAP_TEX(uchar)
|
||||
//OPENCV_GPU_IMPLEMENT_REMAP_TEX(uchar2)
|
||||
OPENCV_GPU_IMPLEMENT_REMAP_TEX(uchar4)
|
||||
OPENCV_CUDA_IMPLEMENT_REMAP_TEX(uchar)
|
||||
//OPENCV_CUDA_IMPLEMENT_REMAP_TEX(uchar2)
|
||||
OPENCV_CUDA_IMPLEMENT_REMAP_TEX(uchar4)
|
||||
|
||||
//OPENCV_GPU_IMPLEMENT_REMAP_TEX(schar)
|
||||
//OPENCV_GPU_IMPLEMENT_REMAP_TEX(char2)
|
||||
//OPENCV_GPU_IMPLEMENT_REMAP_TEX(char4)
|
||||
//OPENCV_CUDA_IMPLEMENT_REMAP_TEX(schar)
|
||||
//OPENCV_CUDA_IMPLEMENT_REMAP_TEX(char2)
|
||||
//OPENCV_CUDA_IMPLEMENT_REMAP_TEX(char4)
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_REMAP_TEX(ushort)
|
||||
//OPENCV_GPU_IMPLEMENT_REMAP_TEX(ushort2)
|
||||
OPENCV_GPU_IMPLEMENT_REMAP_TEX(ushort4)
|
||||
OPENCV_CUDA_IMPLEMENT_REMAP_TEX(ushort)
|
||||
//OPENCV_CUDA_IMPLEMENT_REMAP_TEX(ushort2)
|
||||
OPENCV_CUDA_IMPLEMENT_REMAP_TEX(ushort4)
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_REMAP_TEX(short)
|
||||
//OPENCV_GPU_IMPLEMENT_REMAP_TEX(short2)
|
||||
OPENCV_GPU_IMPLEMENT_REMAP_TEX(short4)
|
||||
OPENCV_CUDA_IMPLEMENT_REMAP_TEX(short)
|
||||
//OPENCV_CUDA_IMPLEMENT_REMAP_TEX(short2)
|
||||
OPENCV_CUDA_IMPLEMENT_REMAP_TEX(short4)
|
||||
|
||||
//OPENCV_GPU_IMPLEMENT_REMAP_TEX(int)
|
||||
//OPENCV_GPU_IMPLEMENT_REMAP_TEX(int2)
|
||||
//OPENCV_GPU_IMPLEMENT_REMAP_TEX(int4)
|
||||
//OPENCV_CUDA_IMPLEMENT_REMAP_TEX(int)
|
||||
//OPENCV_CUDA_IMPLEMENT_REMAP_TEX(int2)
|
||||
//OPENCV_CUDA_IMPLEMENT_REMAP_TEX(int4)
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_REMAP_TEX(float)
|
||||
//OPENCV_GPU_IMPLEMENT_REMAP_TEX(float2)
|
||||
OPENCV_GPU_IMPLEMENT_REMAP_TEX(float4)
|
||||
OPENCV_CUDA_IMPLEMENT_REMAP_TEX(float)
|
||||
//OPENCV_CUDA_IMPLEMENT_REMAP_TEX(float2)
|
||||
OPENCV_CUDA_IMPLEMENT_REMAP_TEX(float4)
|
||||
|
||||
#undef OPENCV_GPU_IMPLEMENT_REMAP_TEX
|
||||
#undef OPENCV_CUDA_IMPLEMENT_REMAP_TEX
|
||||
|
||||
template <template <typename> class Filter, template <typename> class B, typename T> struct RemapDispatcher
|
||||
{
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace cv { namespace cuda { namespace device
|
||||
|
||||
template <typename T> struct TextureAccessor;
|
||||
|
||||
#define OPENCV_GPU_IMPLEMENT_RESIZE_TEX(type) \
|
||||
#define OPENCV_CUDA_IMPLEMENT_RESIZE_TEX(type) \
|
||||
texture<type, cudaTextureType2D, cudaReadModeElementType> tex_resize_##type (0, cudaFilterModePoint, cudaAddressModeClamp); \
|
||||
template <> struct TextureAccessor<type> \
|
||||
{ \
|
||||
@@ -152,19 +152,19 @@ namespace cv { namespace cuda { namespace device
|
||||
} \
|
||||
};
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_RESIZE_TEX(uchar)
|
||||
OPENCV_GPU_IMPLEMENT_RESIZE_TEX(uchar4)
|
||||
OPENCV_CUDA_IMPLEMENT_RESIZE_TEX(uchar)
|
||||
OPENCV_CUDA_IMPLEMENT_RESIZE_TEX(uchar4)
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_RESIZE_TEX(ushort)
|
||||
OPENCV_GPU_IMPLEMENT_RESIZE_TEX(ushort4)
|
||||
OPENCV_CUDA_IMPLEMENT_RESIZE_TEX(ushort)
|
||||
OPENCV_CUDA_IMPLEMENT_RESIZE_TEX(ushort4)
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_RESIZE_TEX(short)
|
||||
OPENCV_GPU_IMPLEMENT_RESIZE_TEX(short4)
|
||||
OPENCV_CUDA_IMPLEMENT_RESIZE_TEX(short)
|
||||
OPENCV_CUDA_IMPLEMENT_RESIZE_TEX(short4)
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_RESIZE_TEX(float)
|
||||
OPENCV_GPU_IMPLEMENT_RESIZE_TEX(float4)
|
||||
OPENCV_CUDA_IMPLEMENT_RESIZE_TEX(float)
|
||||
OPENCV_CUDA_IMPLEMENT_RESIZE_TEX(float4)
|
||||
|
||||
#undef OPENCV_GPU_IMPLEMENT_RESIZE_TEX
|
||||
#undef OPENCV_CUDA_IMPLEMENT_RESIZE_TEX
|
||||
|
||||
template <typename T>
|
||||
TextureAccessor<T> texAccessor(const PtrStepSz<T>& mat, int yoff, int xoff)
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace cv { namespace cuda { namespace device
|
||||
}
|
||||
};
|
||||
|
||||
#define OPENCV_GPU_IMPLEMENT_WARP_TEX(type) \
|
||||
#define OPENCV_CUDA_IMPLEMENT_WARP_TEX(type) \
|
||||
texture< type , cudaTextureType2D > tex_warp_ ## type (0, cudaFilterModePoint, cudaAddressModeClamp); \
|
||||
struct tex_warp_ ## type ## _reader \
|
||||
{ \
|
||||
@@ -235,31 +235,31 @@ namespace cv { namespace cuda { namespace device
|
||||
} \
|
||||
};
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_WARP_TEX(uchar)
|
||||
//OPENCV_GPU_IMPLEMENT_WARP_TEX(uchar2)
|
||||
OPENCV_GPU_IMPLEMENT_WARP_TEX(uchar4)
|
||||
OPENCV_CUDA_IMPLEMENT_WARP_TEX(uchar)
|
||||
//OPENCV_CUDA_IMPLEMENT_WARP_TEX(uchar2)
|
||||
OPENCV_CUDA_IMPLEMENT_WARP_TEX(uchar4)
|
||||
|
||||
//OPENCV_GPU_IMPLEMENT_WARP_TEX(schar)
|
||||
//OPENCV_GPU_IMPLEMENT_WARP_TEX(char2)
|
||||
//OPENCV_GPU_IMPLEMENT_WARP_TEX(char4)
|
||||
//OPENCV_CUDA_IMPLEMENT_WARP_TEX(schar)
|
||||
//OPENCV_CUDA_IMPLEMENT_WARP_TEX(char2)
|
||||
//OPENCV_CUDA_IMPLEMENT_WARP_TEX(char4)
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_WARP_TEX(ushort)
|
||||
//OPENCV_GPU_IMPLEMENT_WARP_TEX(ushort2)
|
||||
OPENCV_GPU_IMPLEMENT_WARP_TEX(ushort4)
|
||||
OPENCV_CUDA_IMPLEMENT_WARP_TEX(ushort)
|
||||
//OPENCV_CUDA_IMPLEMENT_WARP_TEX(ushort2)
|
||||
OPENCV_CUDA_IMPLEMENT_WARP_TEX(ushort4)
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_WARP_TEX(short)
|
||||
//OPENCV_GPU_IMPLEMENT_WARP_TEX(short2)
|
||||
OPENCV_GPU_IMPLEMENT_WARP_TEX(short4)
|
||||
OPENCV_CUDA_IMPLEMENT_WARP_TEX(short)
|
||||
//OPENCV_CUDA_IMPLEMENT_WARP_TEX(short2)
|
||||
OPENCV_CUDA_IMPLEMENT_WARP_TEX(short4)
|
||||
|
||||
//OPENCV_GPU_IMPLEMENT_WARP_TEX(int)
|
||||
//OPENCV_GPU_IMPLEMENT_WARP_TEX(int2)
|
||||
//OPENCV_GPU_IMPLEMENT_WARP_TEX(int4)
|
||||
//OPENCV_CUDA_IMPLEMENT_WARP_TEX(int)
|
||||
//OPENCV_CUDA_IMPLEMENT_WARP_TEX(int2)
|
||||
//OPENCV_CUDA_IMPLEMENT_WARP_TEX(int4)
|
||||
|
||||
OPENCV_GPU_IMPLEMENT_WARP_TEX(float)
|
||||
//OPENCV_GPU_IMPLEMENT_WARP_TEX(float2)
|
||||
OPENCV_GPU_IMPLEMENT_WARP_TEX(float4)
|
||||
OPENCV_CUDA_IMPLEMENT_WARP_TEX(float)
|
||||
//OPENCV_CUDA_IMPLEMENT_WARP_TEX(float2)
|
||||
OPENCV_CUDA_IMPLEMENT_WARP_TEX(float4)
|
||||
|
||||
#undef OPENCV_GPU_IMPLEMENT_WARP_TEX
|
||||
#undef OPENCV_CUDA_IMPLEMENT_WARP_TEX
|
||||
|
||||
template <class Transform, template <typename> class Filter, template <typename> class B, typename T> struct WarpDispatcher
|
||||
{
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
|
||||
#include "test_precomp.hpp"
|
||||
|
||||
CV_GPU_TEST_MAIN("gpu")
|
||||
CV_CUDA_TEST_MAIN("gpu")
|
||||
|
||||
@@ -67,7 +67,7 @@ PARAM_TEST_CASE(PyrDown, cv::cuda::DeviceInfo, cv::Size, MatType, UseRoi)
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(PyrDown, Accuracy)
|
||||
CUDA_TEST_P(PyrDown, Accuracy)
|
||||
{
|
||||
cv::Mat src = randomMat(size, type);
|
||||
|
||||
@@ -80,7 +80,7 @@ GPU_TEST_P(PyrDown, Accuracy)
|
||||
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-4 : 1.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, PyrDown, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, PyrDown, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4), MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
@@ -107,7 +107,7 @@ PARAM_TEST_CASE(PyrUp, cv::cuda::DeviceInfo, cv::Size, MatType, UseRoi)
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(PyrUp, Accuracy)
|
||||
CUDA_TEST_P(PyrUp, Accuracy)
|
||||
{
|
||||
cv::Mat src = randomMat(size, type);
|
||||
|
||||
@@ -120,7 +120,7 @@ GPU_TEST_P(PyrUp, Accuracy)
|
||||
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-4 : 1.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, PyrUp, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, PyrUp, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4), MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
|
||||
@@ -155,7 +155,7 @@ PARAM_TEST_CASE(Remap, cv::cuda::DeviceInfo, cv::Size, MatType, Interpolation, B
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(Remap, Accuracy)
|
||||
CUDA_TEST_P(Remap, Accuracy)
|
||||
{
|
||||
cv::Mat src = randomMat(size, type);
|
||||
cv::Scalar val = randomScalar(0.0, 255.0);
|
||||
@@ -169,7 +169,7 @@ GPU_TEST_P(Remap, Accuracy)
|
||||
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-3 : 1.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, Remap, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, Remap, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
|
||||
@@ -139,7 +139,7 @@ PARAM_TEST_CASE(Resize, cv::cuda::DeviceInfo, cv::Size, MatType, double, Interpo
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(Resize, Accuracy)
|
||||
CUDA_TEST_P(Resize, Accuracy)
|
||||
{
|
||||
cv::Mat src = randomMat(size, type);
|
||||
|
||||
@@ -152,7 +152,7 @@ GPU_TEST_P(Resize, Accuracy)
|
||||
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-2 : 1.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, Resize, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, Resize, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4), MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
@@ -185,7 +185,7 @@ PARAM_TEST_CASE(ResizeSameAsHost, cv::cuda::DeviceInfo, cv::Size, MatType, doubl
|
||||
};
|
||||
|
||||
// downscaling only: used for classifiers
|
||||
GPU_TEST_P(ResizeSameAsHost, Accuracy)
|
||||
CUDA_TEST_P(ResizeSameAsHost, Accuracy)
|
||||
{
|
||||
cv::Mat src = randomMat(size, type);
|
||||
|
||||
@@ -198,7 +198,7 @@ GPU_TEST_P(ResizeSameAsHost, Accuracy)
|
||||
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-2 : 1.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, ResizeSameAsHost, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, ResizeSameAsHost, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4), MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
|
||||
@@ -78,7 +78,7 @@ PARAM_TEST_CASE(BuildWarpAffineMaps, cv::cuda::DeviceInfo, cv::Size, Inverse)
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(BuildWarpAffineMaps, Accuracy)
|
||||
CUDA_TEST_P(BuildWarpAffineMaps, Accuracy)
|
||||
{
|
||||
cv::Mat M = createTransfomMatrix(size, CV_PI / 4);
|
||||
cv::Mat src = randomMat(randomSize(200, 400), CV_8UC1);
|
||||
@@ -101,7 +101,7 @@ GPU_TEST_P(BuildWarpAffineMaps, Accuracy)
|
||||
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, BuildWarpAffineMaps, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, BuildWarpAffineMaps, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
DIRECT_INVERSE));
|
||||
@@ -204,7 +204,7 @@ PARAM_TEST_CASE(WarpAffine, cv::cuda::DeviceInfo, cv::Size, MatType, Inverse, In
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(WarpAffine, Accuracy)
|
||||
CUDA_TEST_P(WarpAffine, Accuracy)
|
||||
{
|
||||
cv::Mat src = randomMat(size, type);
|
||||
cv::Mat M = createTransfomMatrix(size, CV_PI / 3);
|
||||
@@ -222,7 +222,7 @@ GPU_TEST_P(WarpAffine, Accuracy)
|
||||
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-1 : 1.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, WarpAffine, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, WarpAffine, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4), MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
@@ -252,7 +252,7 @@ PARAM_TEST_CASE(WarpAffineNPP, cv::cuda::DeviceInfo, MatType, Inverse, Interpola
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(WarpAffineNPP, Accuracy)
|
||||
CUDA_TEST_P(WarpAffineNPP, Accuracy)
|
||||
{
|
||||
cv::Mat src = readImageType("stereobp/aloe-L.png", type);
|
||||
ASSERT_FALSE(src.empty());
|
||||
@@ -271,7 +271,7 @@ GPU_TEST_P(WarpAffineNPP, Accuracy)
|
||||
EXPECT_MAT_SIMILAR(dst_gold, dst, 2e-2);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, WarpAffineNPP, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, WarpAffineNPP, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
DIRECT_INVERSE,
|
||||
|
||||
@@ -79,7 +79,7 @@ PARAM_TEST_CASE(BuildWarpPerspectiveMaps, cv::cuda::DeviceInfo, cv::Size, Invers
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(BuildWarpPerspectiveMaps, Accuracy)
|
||||
CUDA_TEST_P(BuildWarpPerspectiveMaps, Accuracy)
|
||||
{
|
||||
cv::Mat M = createTransfomMatrix(size, CV_PI / 4);
|
||||
|
||||
@@ -102,7 +102,7 @@ GPU_TEST_P(BuildWarpPerspectiveMaps, Accuracy)
|
||||
EXPECT_MAT_NEAR(dst_gold, dst, 0.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, BuildWarpPerspectiveMaps, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, BuildWarpPerspectiveMaps, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
DIRECT_INVERSE));
|
||||
@@ -207,7 +207,7 @@ PARAM_TEST_CASE(WarpPerspective, cv::cuda::DeviceInfo, cv::Size, MatType, Invers
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(WarpPerspective, Accuracy)
|
||||
CUDA_TEST_P(WarpPerspective, Accuracy)
|
||||
{
|
||||
cv::Mat src = randomMat(size, type);
|
||||
cv::Mat M = createTransfomMatrix(size, CV_PI / 3);
|
||||
@@ -225,7 +225,7 @@ GPU_TEST_P(WarpPerspective, Accuracy)
|
||||
EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-1 : 1.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, WarpPerspective, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, WarpPerspective, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4), MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
@@ -255,7 +255,7 @@ PARAM_TEST_CASE(WarpPerspectiveNPP, cv::cuda::DeviceInfo, MatType, Inverse, Inte
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(WarpPerspectiveNPP, Accuracy)
|
||||
CUDA_TEST_P(WarpPerspectiveNPP, Accuracy)
|
||||
{
|
||||
cv::Mat src = readImageType("stereobp/aloe-L.png", type);
|
||||
ASSERT_FALSE(src.empty());
|
||||
@@ -274,7 +274,7 @@ GPU_TEST_P(WarpPerspectiveNPP, Accuracy)
|
||||
EXPECT_MAT_SIMILAR(dst_gold, dst, 2e-2);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Warping, WarpPerspectiveNPP, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Warping, WarpPerspectiveNPP, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
DIRECT_INVERSE,
|
||||
|
||||
Reference in New Issue
Block a user