updated solvePnpRansac performance test

This commit is contained in:
Alexey Spizhevoy
2011-03-07 13:36:47 +00:00
parent 673061fb17
commit 1d62fddd31
3 changed files with 38 additions and 26 deletions

View File

@@ -145,6 +145,8 @@ void cv::gpu::projectPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec,
namespace cv { namespace gpu { namespace solve_pnp_ransac
{
int maxNumIters();
void computeHypothesisScores(
const int num_hypotheses, const int num_points, const float* rot_matrices,
const float3* transl_vectors, const float3* object, const float2* image,
@@ -241,6 +243,7 @@ void cv::gpu::solvePnpRansac(const Mat& object, const Mat& image, const Mat& cam
CV_Assert(object.cols == image.cols);
CV_Assert(camera_mat.size() == Size(3, 3) && camera_mat.type() == CV_32F);
CV_Assert(!params.use_extrinsic_guess); // We don't support initial guess for now
CV_Assert(params.num_iters <= solve_pnp_ransac::maxNumIters());
const int num_points = object.cols;
CV_Assert(num_points >= params.subset_size);

View File

@@ -43,7 +43,7 @@
#include "internal_shared.hpp"
#include "opencv2/gpu/device/transform.hpp"
#define SOLVE_PNP_RANSAC_NUM_ITERS 200
#define SOLVE_PNP_RANSAC_MAX_NUM_ITERS 200
namespace cv { namespace gpu
{
@@ -120,8 +120,13 @@ namespace cv { namespace gpu
namespace solve_pnp_ransac
{
__constant__ float3 crot_matrices[SOLVE_PNP_RANSAC_NUM_ITERS * 3];
__constant__ float3 ctransl_vectors[SOLVE_PNP_RANSAC_NUM_ITERS];
__constant__ float3 crot_matrices[SOLVE_PNP_RANSAC_MAX_NUM_ITERS * 3];
__constant__ float3 ctransl_vectors[SOLVE_PNP_RANSAC_MAX_NUM_ITERS];
int maxNumIters()
{
return SOLVE_PNP_RANSAC_MAX_NUM_ITERS;
}
__device__ float sqr(float x)
{