Niko
Niko

Reputation: 26730

How can solvePnPRansac be used with double values?

I'm trying to use OpenCV's solvePnPRansac() to compute the 3D pose from a known 2D projection of the object. My values (intrinsic camera parameters, model points (3D), image points (2D)) are all double values. The normal solvePnP() does not complain about that.

However, when I try to use solvePnPRansac, it yields an error message:

Assertion failed < opoints.depth() == CV_32F >

How can I use this function with double values? (working with float does not give the desired results)

Upvotes: 2

Views: 2061

Answers (1)

N2T
N2T

Reputation: 21

Today I have tested the SolvePnPRAnsac, for ITERATIVE AND P3P the results seems to be the same, but when I used these results to rendered my object, the redered image is very different from the current frame. In case of EPnP option, the translation vector is very similar to the ITERATIVE and P3P results but the rotation is very different from the other two options'. However the rendered image I got from Epnp result is very good, it seems like there some problem with P3P and ITERATIVE in implementation the algorithm.

Upvotes: 2

Related Questions