Ask Your Question

How to verify the accuracy of solvePnP return values?

asked 2017-05-19 01:34:36 -0500

djkpA gravatar image

Hello , I have used solvePnP to find the Pose of object and I am getting some results for rvet and tvet. Now I wanted to know how accurate they are.

How to I compute the accuracy of retunred values of solvePnP? 1 method I found was re-projection error.

But is there any way to generate test cases:

Data need to generate as test cases:

(image points, object points)

(expected rvet, expected tvet)

Result: (computed rvet, computed tvet) - return values from solvePnP with each test case that we generated.

And now comparing the ((expected rvet, expected tvet) and (computed rvet, computed tvet) to measure the accuracy for different flags available for solvePnP.

Are there any ways/software/tools that helps me to generate accurate test cases.(Varieties of test cases may include nose environment, distance of object from camera varies, planar object points, non co-planar object points .. etc) ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-05-19 09:14:04 -0500

You can generate a set of 3d points and a known transformation. Then use projectPoints with these values and some intrinsic camera matrix. This will create a set of 3d points, a transformation and 2d points that you can use as a test case.

so roughly

projectPoints(3d_points, R, t, camMatrix) -> 2d_points


solvePnP(2d_points, 3d_points, camMatrix) -> (R,t)
edit flag offensive delete link more


How do I get R, t for projectPoints. Do I need to measure them manually? Is there any tool to simulate a 3D model and generate that data?

djkpA gravatar imagedjkpA ( 2017-05-20 00:33:04 -0500 )edit

This is your free choice. "projectPoints" IS a tool to simulate the scene.

FooBar gravatar imageFooBar ( 2017-05-22 09:10:36 -0500 )edit

Thanks all,

Someone Please let know how to validate the output of solvepnp() as result is coming unexpected .i mean camera position is coming in wrong location . i need to cross verify if rvec and tvec is correct manually

naik gravatar imagenaik ( 2020-06-15 10:46:26 -0500 )edit

Question Tools

1 follower


Asked: 2017-05-19 01:34:36 -0500

Seen: 1,188 times

Last updated: May 19 '17