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, DisparityBilateralFilter, testing::ValuesIn(devices())) { DeviceInfo devInfo = GetParam(); setDevice(devInfo.deviceID()); Mat img_host = readImage("gpu/stereobm/aloe-L.png", CV_LOAD_IMAGE_GRAYSCALE); Mat disp_host = readImage("gpu/stereobm/aloe-disp.png", CV_LOAD_IMAGE_GRAYSCALE); ASSERT_FALSE(img_host.empty()); ASSERT_FALSE(disp_host.empty()); GpuMat img(img_host); GpuMat disp(disp_host); GpuMat dst; DisparityBilateralFilter f(128); declare.time(0.5).iterations(100); SIMPLE_TEST_CYCLE() { f(disp, img, 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(AddWeighted, cv::gpu::DeviceInfo, cv::Size, perf::MatType) { cv::gpu::DeviceInfo devInfo = GET_PARAM(0); cv::Size size = GET_PARAM(1); int type = GET_PARAM(2); cv::gpu::setDevice(devInfo.deviceID()); cv::Mat src1_host(size, type); cv::Mat src2_host(size, type); fill(src1_host, 0.0, 100.0); fill(src2_host, 0.0, 100.0); cv::gpu::GpuMat src1(src1_host); cv::gpu::GpuMat src2(src2_host); cv::gpu::GpuMat dst; TEST_CYCLE() { cv::gpu::addWeighted(src1, 0.5, src2, 0.5, 0.0, dst); } cv::Mat dst_host(dst); }
PERF_TEST_P(DevInfo_Size_MatType, transpose, testing::Combine(testing::ValuesIn(devices()), testing::Values(GPU_TYPICAL_MAT_SIZES), testing::Values(CV_8UC1, CV_32SC1, CV_64FC1))) { DeviceInfo devInfo = std::tr1::get<0>(GetParam()); Size size = std::tr1::get<1>(GetParam()); int type = std::tr1::get<2>(GetParam()); setDevice(devInfo.deviceID()); Mat src_host(size, type); declare.in(src_host, WARMUP_RNG); GpuMat src(src_host); GpuMat dst(size.width, size.height, type); declare.time(0.5).iterations(100); SIMPLE_TEST_CYCLE() { transpose(src, dst); } Mat dst_host(dst); SANITY_CHECK(dst_host); }
GPU_PERF_TEST(Reduce, cv::gpu::DeviceInfo, cv::Size, perf::MatType, FlipCode) { cv::gpu::DeviceInfo devInfo = GET_PARAM(0); cv::Size size = GET_PARAM(1); int type = GET_PARAM(2); int dim = GET_PARAM(3); cv::gpu::setDevice(devInfo.deviceID()); cv::Mat src_host(size, type); fill(src_host, 0.0, 10.0); cv::gpu::GpuMat src(src_host); cv::gpu::GpuMat dst; TEST_CYCLE() { cv::gpu::reduce(src, dst, dim, CV_REDUCE_MIN); } cv::Mat dst_host(dst); }
PERF_TEST_P(DevInfo, projectPoints, testing::ValuesIn(devices())) { DeviceInfo devInfo = GetParam(); setDevice(devInfo.deviceID()); Mat src_host(1, 10000, CV_32FC3); declare.in(src_host, WARMUP_RNG); GpuMat src(src_host); GpuMat dst; declare.time(0.5).iterations(100); SIMPLE_TEST_CYCLE() { projectPoints(src, Mat::ones(1, 3, CV_32FC1), Mat::ones(1, 3, CV_32FC1), Mat::ones(3, 3, CV_32FC1), Mat(), dst); } Mat dst_host(dst); SANITY_CHECK(dst_host); }