2012-05-22 18:29:58 +08:00
|
|
|
#include "perf_cpu_precomp.hpp"
|
2012-05-22 16:29:08 +08:00
|
|
|
|
|
|
|
#ifdef HAVE_CUDA
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// ProjectPoints
|
|
|
|
|
|
|
|
GPU_PERF_TEST_1(ProjectPoints, cv::gpu::DeviceInfo)
|
|
|
|
{
|
2012-05-22 18:29:58 +08:00
|
|
|
cv::Mat src(1, 10000, CV_32FC3);
|
2012-05-22 16:29:08 +08:00
|
|
|
|
2012-05-22 18:29:58 +08:00
|
|
|
declare.in(src, WARMUP_RNG);
|
2012-05-22 16:29:08 +08:00
|
|
|
|
2012-05-22 18:29:58 +08:00
|
|
|
cv::Mat dst;
|
2012-05-22 16:29:08 +08:00
|
|
|
|
|
|
|
TEST_CYCLE()
|
|
|
|
{
|
2012-05-22 18:29:58 +08:00
|
|
|
cv::projectPoints(src, cv::Mat::ones(1, 3, CV_32FC1), cv::Mat::ones(1, 3, CV_32FC1), cv::Mat::ones(3, 3, CV_32FC1), cv::Mat(), dst);
|
2012-05-22 16:29:08 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
INSTANTIATE_TEST_CASE_P(Calib3D, ProjectPoints, ALL_DEVICES);
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// SolvePnPRansac
|
|
|
|
|
|
|
|
GPU_PERF_TEST_1(SolvePnPRansac, cv::gpu::DeviceInfo)
|
|
|
|
{
|
|
|
|
cv::Mat object(1, 10000, CV_32FC3);
|
|
|
|
cv::Mat image(1, 10000, CV_32FC2);
|
|
|
|
|
|
|
|
declare.in(object, image, WARMUP_RNG);
|
|
|
|
|
|
|
|
cv::Mat rvec, tvec;
|
|
|
|
|
|
|
|
declare.time(3.0);
|
|
|
|
|
|
|
|
TEST_CYCLE()
|
|
|
|
{
|
2012-05-22 18:29:58 +08:00
|
|
|
cv::solvePnPRansac(object, image, cv::Mat::ones(3, 3, CV_32FC1), cv::Mat(1, 8, CV_32F, cv::Scalar::all(0)), rvec, tvec);
|
2012-05-22 16:29:08 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
INSTANTIATE_TEST_CASE_P(Calib3D, SolvePnPRansac, ALL_DEVICES);
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// StereoBM
|
|
|
|
|
|
|
|
GPU_PERF_TEST_1(StereoBM, cv::gpu::DeviceInfo)
|
|
|
|
{
|
2012-05-22 18:29:58 +08:00
|
|
|
cv::Mat img_l = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);
|
|
|
|
cv::Mat img_r = readImage("gpu/perf/aloeR.jpg", cv::IMREAD_GRAYSCALE);
|
2012-05-22 16:29:08 +08:00
|
|
|
|
2012-05-22 18:29:58 +08:00
|
|
|
ASSERT_FALSE(img_l.empty());
|
|
|
|
ASSERT_FALSE(img_r.empty());
|
2012-05-22 16:29:08 +08:00
|
|
|
|
2012-05-22 18:29:58 +08:00
|
|
|
cv::Mat dst;
|
2012-05-22 16:29:08 +08:00
|
|
|
|
2012-05-22 18:29:58 +08:00
|
|
|
cv::StereoBM bm(0, 256);
|
2012-05-22 16:29:08 +08:00
|
|
|
|
|
|
|
declare.time(5.0);
|
|
|
|
|
|
|
|
TEST_CYCLE()
|
|
|
|
{
|
|
|
|
bm(img_l, img_r, dst);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
INSTANTIATE_TEST_CASE_P(Calib3D, StereoBM, ALL_DEVICES);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|