PERF_TEST_P(DevInfo, StereoBM, testing::ValuesIn(devices())) { DeviceInfo devInfo = GetParam(); setDevice(devInfo.deviceID()); Mat img_l_host = readImage("gpu/perf/aloe.jpg", CV_LOAD_IMAGE_GRAYSCALE); Mat img_r_host = readImage("gpu/perf/aloeR.jpg", CV_LOAD_IMAGE_GRAYSCALE); ASSERT_FALSE(img_l_host.empty()); ASSERT_FALSE(img_r_host.empty()); GpuMat img_l(img_l_host); GpuMat img_r(img_r_host); GpuMat dst; StereoBM_GPU bm(0, 256); declare.time(0.5).iterations(100); SIMPLE_TEST_CYCLE() { bm(img_l, img_r, dst); } Mat dst_host(dst); SANITY_CHECK(dst_host); }
PERF_TEST_P(DevInfo, StereoConstantSpaceBP, testing::ValuesIn(devices())) { DeviceInfo devInfo = GetParam(); setDevice(devInfo.deviceID()); Mat img_l_host = readImage("gpu/perf/aloe.jpg", CV_LOAD_IMAGE_GRAYSCALE); Mat img_r_host = readImage("gpu/perf/aloeR.jpg", CV_LOAD_IMAGE_GRAYSCALE); ASSERT_FALSE(img_l_host.empty()); ASSERT_FALSE(img_r_host.empty()); GpuMat img_l(img_l_host); GpuMat img_r(img_r_host); GpuMat dst; StereoConstantSpaceBP bp(128); declare.time(10.0); SIMPLE_TEST_CYCLE() { bp(img_l, img_r, dst); } Mat dst_host(dst); SANITY_CHECK(dst_host); }
PERF_TEST_P(DevInfo, StereoBeliefPropagation, testing::ValuesIn(devices())) { DeviceInfo devInfo = GetParam(); setDevice(devInfo.deviceID()); Mat img_l_host = readImage("gpu/stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE); Mat img_r_host = readImage("gpu/stereobm/aloe-R.png", CV_LOAD_IMAGE_GRAYSCALE); ASSERT_FALSE(img_l_host.empty()); ASSERT_FALSE(img_r_host.empty()); GpuMat img_l(img_l_host); GpuMat img_r(img_r_host); GpuMat dst; StereoBeliefPropagation bp(128); declare.time(10.0); SIMPLE_TEST_CYCLE() { bp(img_l, img_r, dst); } Mat dst_host(dst); SANITY_CHECK(dst_host); }
GPU_PERF_TEST_1(StereoBM, cv::gpu::DeviceInfo) { cv::gpu::DeviceInfo devInfo = GetParam(); cv::gpu::setDevice(devInfo.deviceID()); cv::Mat img_l_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE); ASSERT_FALSE(img_l_host.empty()); cv::Mat img_r_host = readImage("gpu/perf/aloeR.jpg", cv::IMREAD_GRAYSCALE); ASSERT_FALSE(img_r_host.empty()); cv::gpu::StereoBM_GPU bm(0, 256); cv::gpu::GpuMat img_l(img_l_host); cv::gpu::GpuMat img_r(img_r_host); cv::gpu::GpuMat dst; bm(img_l, img_r, dst); declare.time(5.0); TEST_CYCLE() { bm(img_l, img_r, dst); } }
GPU_PERF_TEST_1(StereoConstantSpaceBP, cv::gpu::DeviceInfo) { cv::gpu::DeviceInfo devInfo = GetParam(); cv::gpu::setDevice(devInfo.deviceID()); cv::Mat img_l_host = readImage("gpu/stereobm/aloe-L.png", cv::IMREAD_GRAYSCALE); ASSERT_FALSE(img_l_host.empty()); cv::Mat img_r_host = readImage("gpu/stereobm/aloe-R.png", cv::IMREAD_GRAYSCALE); ASSERT_FALSE(img_r_host.empty()); cv::gpu::StereoConstantSpaceBP csbp(128); cv::gpu::GpuMat img_l(img_l_host); cv::gpu::GpuMat img_r(img_r_host); cv::gpu::GpuMat dst; csbp(img_l, img_r, dst); declare.time(10.0); TEST_CYCLE() { csbp(img_l, img_r, dst); } }
GPU_PERF_TEST_1(StereoBeliefPropagation, cv::gpu::DeviceInfo) { cv::gpu::DeviceInfo devInfo = GetParam(); cv::gpu::setDevice(devInfo.deviceID()); cv::Mat img_l_host = readImage("gpu/stereobp/aloe-L.png"); ASSERT_FALSE(img_l_host.empty()); cv::Mat img_r_host = readImage("gpu/stereobp/aloe-R.png"); ASSERT_FALSE(img_r_host.empty()); cv::gpu::StereoBeliefPropagation bp(64); cv::gpu::GpuMat img_l(img_l_host); cv::gpu::GpuMat img_r(img_r_host); cv::gpu::GpuMat dst; bp(img_l, img_r, dst); declare.time(10.0); TEST_CYCLE() { bp(img_l, img_r, dst); } }