added performance test for gpu::projectPoints function
This commit is contained in:
parent
289af671ee
commit
b97d8fd656
@ -1,6 +1,7 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <opencv2/imgproc/imgproc.hpp>
|
#include <opencv2/imgproc/imgproc.hpp>
|
||||||
#include <opencv2/highgui/highgui.hpp>
|
#include <opencv2/highgui/highgui.hpp>
|
||||||
|
#include <opencv2/calib3d/calib3d.hpp>
|
||||||
#include <opencv2/gpu/gpu.hpp>
|
#include <opencv2/gpu/gpu.hpp>
|
||||||
#include "performance.h"
|
#include "performance.h"
|
||||||
|
|
||||||
@ -743,4 +744,39 @@ TEST(threshold)
|
|||||||
gpu::threshold(d_src, d_dst, 50.0, 0.0, THRESH_TRUNC);
|
gpu::threshold(d_src, d_dst, 50.0, 0.0, THRESH_TRUNC);
|
||||||
GPU_OFF;
|
GPU_OFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
TEST(projectPoints)
|
||||||
|
{
|
||||||
|
Mat src;
|
||||||
|
vector<Point2f> dst;
|
||||||
|
gpu::GpuMat d_src, d_dst;
|
||||||
|
|
||||||
|
Mat rvec; gen(rvec, 1, 3, CV_32F, 0, 1);
|
||||||
|
Mat tvec; gen(tvec, 1, 3, CV_32F, 0, 1);
|
||||||
|
Mat camera_mat; gen(camera_mat, 3, 3, CV_32F, 0, 1);
|
||||||
|
camera_mat.at<float>(0, 1) = 0.f;
|
||||||
|
camera_mat.at<float>(1, 0) = 0.f;
|
||||||
|
camera_mat.at<float>(2, 0) = 0.f;
|
||||||
|
camera_mat.at<float>(2, 1) = 0.f;
|
||||||
|
|
||||||
|
for (int size = 1e6, count = 0; size >= 1e5 && count < 5; size /= 1.4, count++)
|
||||||
|
{
|
||||||
|
SUBTEST << "size " << size;
|
||||||
|
|
||||||
|
gen(src, 1, size, CV_32FC3, Scalar::all(0), Scalar::all(10));
|
||||||
|
dst.resize(size);
|
||||||
|
|
||||||
|
CPU_ON;
|
||||||
|
projectPoints(src, rvec, tvec, camera_mat, Mat(), dst);
|
||||||
|
CPU_OFF;
|
||||||
|
|
||||||
|
d_src = src;
|
||||||
|
d_dst.create(1, size, CV_32FC2);
|
||||||
|
|
||||||
|
GPU_ON;
|
||||||
|
gpu::projectPoints(d_src, rvec, tvec, camera_mat, Mat(), d_dst);
|
||||||
|
GPU_OFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user