Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a specific pnp implementation #4

Closed
sontung opened this issue Jun 2, 2022 · 5 comments
Closed

a specific pnp implementation #4

sontung opened this issue Jun 2, 2022 · 5 comments

Comments

@sontung
Copy link

sontung commented Jun 2, 2022

Hi,

I would like to ask what is the implementation of the PnP algorithm that you used to compute the estimated pose of your localization algorithm? I'm asking because I am having some problems with mine (correct 2d-3d matching but large differences w.r.t ground-truth poses). I am currently using openCV's solvePNPRansac. Thanks.

@tsattler
Copy link
Owner

tsattler commented Jun 2, 2022

We used different implementations for different methods. For Active Search, we used the P3P implementation from the examples of the RansacLib library.

@ebrach
Copy link
Collaborator

ebrach commented Jun 2, 2022

DSAC* uses OpenCVs P3P as a minimal solver, and OpenCVs "iterative" (that is Levenberg-Marquardt) for refinement on all inliers. Despite using OpenCVs solvers, DSAC* does not use OpenCVs RANSAC implementation, but a custom one. Not sure what solvePNPRansac does exactly. Worth checking what solvers it uses in your case, and whether it refines the estimate on all inliers. The OpenCV docs seem to say that EPNP is used by default as a minimal solver, and "iterative" as refinement. I had mixed experiences with EPNP - I found P3P to work much better in my experiments. (But not clear what solvePNPRansac does if you specify P3P as a solver flag - whether it still refines using "iterative" or not. Better check.)

@sontung
Copy link
Author

sontung commented Jun 3, 2022

I was using opencv's SQ-PNP to be exact. With this I was able to get around 96% on RedKitchen from 7scenes, however, in many bad cases, my matches are good enough. I just tried with lambda-twist pnp. With proper parameters, I was able to get 98.5%, however, the curve is not as good as the ones from other High performance algorithms. It seems to me that different PnP algorithms or implementations provide slightly different results. Is it possible that we make one default PnP solver for all the algorithms or take into account the accuracy of the matches? To analyze the accuracy of the matches, we can project 3d points using GT poses and then compute the difference between matched 2d points and projected 2d points.

@tsattler
Copy link
Owner

tsattler commented Jun 3, 2022

In my experience, doing proper local optimization can make quite a difference (including whether or not to use a robust cost function). I recommend using the pose estimation implementation in PoseLib (https://github.com/vlarsson/PoseLib).

@sontung
Copy link
Author

sontung commented Jun 6, 2022

I just tried PoseLib and it seemed to solve my problem. Thanks!

@sontung sontung closed this as completed Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants