r/computervision • • Jun 23 '19

[Question] is-camera-pose-estimation-with-solvepnp-epnp-sensitive-to-outliers-and-can-this

https://stackoverflow.com/questions/56725085/is-camera-pose-estimation-with-solvepnp-epnp-sensitive-to-outliers-and-can-this
0 Upvotes

2 comments sorted by

4

u/tdgros Jun 23 '19

RANSAC is robust to outliers, the different methods proposed by solvePnP are not. OpenCV offers a solvePnPRansac which runs solvePnP within RANSAC so you get the best of both worlds.

Another way, when you have a reasonable prior, you can rate the matches according to the prior, remove the very bad matches, run solvePnP, and re-start. If you were to re-implement your own PnP, you could re-weight samples according to their reprojection error (for instance with the Huber loss)

2

u/TCW_Jocki Jun 23 '19 edited Jun 23 '19

Thanks for the answer, as mentioned in the SO question that was my initial thought. I will try to find the missmatches from the RANSAC method and use the solvePNP() method again with the remaining points and see what happens.

EDIT: tried it out and running the method with filtered missmatches also has the same result. The error therefore is somewhere else.