mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
replaced GPU -> CUDA
This commit is contained in:
@@ -65,7 +65,7 @@ PERF_TEST_P(ImagePair, StereoBM,
|
||||
|
||||
const int ndisp = 256;
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
cv::Ptr<cv::StereoBM> d_bm = cv::cuda::createStereoBM(ndisp);
|
||||
|
||||
@@ -75,7 +75,7 @@ PERF_TEST_P(ImagePair, StereoBM,
|
||||
|
||||
TEST_CYCLE() d_bm->compute(d_imgLeft, d_imgRight, dst);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -105,7 +105,7 @@ PERF_TEST_P(ImagePair, StereoBeliefPropagation,
|
||||
|
||||
const int ndisp = 64;
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
cv::Ptr<cv::cuda::StereoBeliefPropagation> d_bp = cv::cuda::createStereoBeliefPropagation(ndisp);
|
||||
|
||||
@@ -115,7 +115,7 @@ PERF_TEST_P(ImagePair, StereoBeliefPropagation,
|
||||
|
||||
TEST_CYCLE() d_bp->compute(d_imgLeft, d_imgRight, dst);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -139,7 +139,7 @@ PERF_TEST_P(ImagePair, StereoConstantSpaceBP,
|
||||
|
||||
const int ndisp = 128;
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
cv::Ptr<cv::cuda::StereoConstantSpaceBP> d_csbp = cv::cuda::createStereoConstantSpaceBP(ndisp);
|
||||
|
||||
@@ -149,7 +149,7 @@ PERF_TEST_P(ImagePair, StereoConstantSpaceBP,
|
||||
|
||||
TEST_CYCLE() d_csbp->compute(d_imgLeft, d_imgRight, dst);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -171,7 +171,7 @@ PERF_TEST_P(ImagePair, DisparityBilateralFilter,
|
||||
|
||||
const int ndisp = 128;
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
cv::Ptr<cv::cuda::DisparityBilateralFilter> d_filter = cv::cuda::createDisparityBilateralFilter(ndisp);
|
||||
|
||||
@@ -181,7 +181,7 @@ PERF_TEST_P(ImagePair, DisparityBilateralFilter,
|
||||
|
||||
TEST_CYCLE() d_filter->apply(d_disp, d_img, dst);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -193,7 +193,7 @@ PERF_TEST_P(ImagePair, DisparityBilateralFilter,
|
||||
// ReprojectImageTo3D
|
||||
|
||||
PERF_TEST_P(Sz_Depth, ReprojectImageTo3D,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16S)))
|
||||
{
|
||||
const cv::Size size = GET_PARAM(0);
|
||||
@@ -205,14 +205,14 @@ PERF_TEST_P(Sz_Depth, ReprojectImageTo3D,
|
||||
cv::Mat Q(4, 4, CV_32FC1);
|
||||
cv::randu(Q, 0.1, 1.0);
|
||||
|
||||
if (PERF_RUN_GPU())
|
||||
if (PERF_RUN_CUDA())
|
||||
{
|
||||
const cv::cuda::GpuMat d_src(src);
|
||||
cv::cuda::GpuMat dst;
|
||||
|
||||
TEST_CYCLE() cv::cuda::reprojectImageTo3D(d_src, dst, Q);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -228,7 +228,7 @@ PERF_TEST_P(Sz_Depth, ReprojectImageTo3D,
|
||||
// DrawColorDisp
|
||||
|
||||
PERF_TEST_P(Sz_Depth, DrawColorDisp,
|
||||
Combine(GPU_TYPICAL_MAT_SIZES,
|
||||
Combine(CUDA_TYPICAL_MAT_SIZES,
|
||||
Values(CV_8U, CV_16S)))
|
||||
{
|
||||
const cv::Size size = GET_PARAM(0);
|
||||
@@ -237,14 +237,14 @@ PERF_TEST_P(Sz_Depth, DrawColorDisp,
|
||||
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::drawColorDisp(d_src, dst, 255);
|
||||
|
||||
GPU_SANITY_CHECK(dst);
|
||||
CUDA_SANITY_CHECK(dst);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -343,7 +343,7 @@ namespace cv { namespace cuda { namespace device
|
||||
};
|
||||
const int calles_num = sizeof(callers)/sizeof(callers[0]);
|
||||
|
||||
void stereoBM_GPU(const PtrStepSzb& left, const PtrStepSzb& right, const PtrStepSzb& disp, int maxdisp, int winsz, const PtrStepSz<unsigned int>& minSSD_buf, cudaStream_t& stream)
|
||||
void stereoBM_CUDA(const PtrStepSzb& left, const PtrStepSzb& right, const PtrStepSzb& disp, int maxdisp, int winsz, const PtrStepSz<unsigned int>& minSSD_buf, cudaStream_t& stream)
|
||||
{
|
||||
int winsz2 = winsz >> 1;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace cv { namespace cuda { namespace device
|
||||
{
|
||||
namespace stereobm
|
||||
{
|
||||
void stereoBM_GPU(const PtrStepSzb& left, const PtrStepSzb& right, const PtrStepSzb& disp, int ndisp, int winsz, const PtrStepSz<unsigned int>& minSSD_buf, cudaStream_t & stream);
|
||||
void stereoBM_CUDA(const PtrStepSzb& left, const PtrStepSzb& right, const PtrStepSzb& disp, int ndisp, int winsz, const PtrStepSz<unsigned int>& minSSD_buf, cudaStream_t & stream);
|
||||
void prefilter_xsobel(const PtrStepSzb& input, const PtrStepSzb& output, int prefilterCap /*= 31*/, cudaStream_t & stream);
|
||||
void postfilter_textureness(const PtrStepSzb& input, int winsz, float avgTexturenessThreshold, const PtrStepSzb& disp, cudaStream_t & stream);
|
||||
}
|
||||
@@ -170,7 +170,7 @@ namespace
|
||||
ri_for_bm = riBuf_;
|
||||
}
|
||||
|
||||
stereoBM_GPU(le_for_bm, ri_for_bm, disparity, ndisp_, winSize_, minSSD_, stream);
|
||||
stereoBM_CUDA(le_for_bm, ri_for_bm, disparity, ndisp_, winSize_, minSSD_, stream);
|
||||
|
||||
if (avergeTexThreshold_ > 0)
|
||||
postfilter_textureness(le_for_bm, winSize_, avergeTexThreshold_, disparity, stream);
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
|
||||
#include "test_precomp.hpp"
|
||||
|
||||
CV_GPU_TEST_MAIN("gpu")
|
||||
CV_CUDA_TEST_MAIN("gpu")
|
||||
|
||||
@@ -61,7 +61,7 @@ struct StereoBM : testing::TestWithParam<cv::cuda::DeviceInfo>
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(StereoBM, Regression)
|
||||
CUDA_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);
|
||||
@@ -79,7 +79,7 @@ GPU_TEST_P(StereoBM, Regression)
|
||||
EXPECT_MAT_NEAR(disp_gold, disp, 0.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Stereo, StereoBM, ALL_DEVICES);
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Stereo, StereoBM, ALL_DEVICES);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// StereoBeliefPropagation
|
||||
@@ -96,7 +96,7 @@ struct StereoBeliefPropagation : testing::TestWithParam<cv::cuda::DeviceInfo>
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(StereoBeliefPropagation, Regression)
|
||||
CUDA_TEST_P(StereoBeliefPropagation, Regression)
|
||||
{
|
||||
cv::Mat left_image = readImage("stereobp/aloe-L.png");
|
||||
cv::Mat right_image = readImage("stereobp/aloe-R.png");
|
||||
@@ -122,7 +122,7 @@ GPU_TEST_P(StereoBeliefPropagation, Regression)
|
||||
EXPECT_MAT_NEAR(disp_gold, h_disp, 0.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Stereo, StereoBeliefPropagation, ALL_DEVICES);
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Stereo, StereoBeliefPropagation, ALL_DEVICES);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// StereoConstantSpaceBP
|
||||
@@ -139,7 +139,7 @@ struct StereoConstantSpaceBP : testing::TestWithParam<cv::cuda::DeviceInfo>
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(StereoConstantSpaceBP, Regression)
|
||||
CUDA_TEST_P(StereoConstantSpaceBP, Regression)
|
||||
{
|
||||
cv::Mat left_image = readImage("csstereobp/aloe-L.png");
|
||||
cv::Mat right_image = readImage("csstereobp/aloe-R.png");
|
||||
@@ -166,7 +166,7 @@ GPU_TEST_P(StereoConstantSpaceBP, Regression)
|
||||
EXPECT_MAT_NEAR(disp_gold, h_disp, 1.0);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Stereo, StereoConstantSpaceBP, ALL_DEVICES);
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Stereo, StereoConstantSpaceBP, ALL_DEVICES);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// reprojectImageTo3D
|
||||
@@ -189,7 +189,7 @@ PARAM_TEST_CASE(ReprojectImageTo3D, cv::cuda::DeviceInfo, cv::Size, MatDepth, Us
|
||||
}
|
||||
};
|
||||
|
||||
GPU_TEST_P(ReprojectImageTo3D, Accuracy)
|
||||
CUDA_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);
|
||||
@@ -203,7 +203,7 @@ GPU_TEST_P(ReprojectImageTo3D, Accuracy)
|
||||
EXPECT_MAT_NEAR(dst_gold, dst, 1e-5);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(GPU_Stereo, ReprojectImageTo3D, testing::Combine(
|
||||
INSTANTIATE_TEST_CASE_P(CUDA_Stereo, ReprojectImageTo3D, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
testing::Values(MatDepth(CV_8U), MatDepth(CV_16S)),
|
||||
|
||||
Reference in New Issue
Block a user