You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var rvec = new double[] { 0, 0, 0 };
var tvec = new double[] { 0, 0, 0 };
var m = new double[3, 3]
{
{ 1, 0, 0 },
{ 0, 1, 0 },
{ 0, 0, 1 }
};
var dist = new double[] { 0, 0, 0, 0, 0 };
var objPts = new Point3f[]
{
new Point3f(0,0,1),
new Point3f(1,0,1),
new Point3f(0,1,1),
new Point3f(1,1,1),
new Point3f(1,0,2),
new Point3f(0,1,2)
};
double[,] jacobian;
Point2f[] imgPts;
Cv2.ProjectPoints(objPts, rvec, tvec, m, dist, out imgPts, out jacobian);
Cv2.SolvePnP(objPts, imgPts, m, dist, out rvec, out tvec);
Summary of your issue
The SolvePnP overload that uses IEnumerable sets of points throws the Exception shown below. Apparently I'm not the first person to discover this problem: https://stackoverflow.com/questions/37279776/how-to-fix-unhandled-opencvexception-from-calling-cv2-solvepnp
Environment
Visual Studio 2015
OpenCVSharp3-AnyCPU v3.2.0.20170911
What did you do when you faced the problem?
Invoked Cv2.SolvePnP
Example code:
Output:
What did you intend to be?
I intended for SolvePnP to work properly given valid inputs.
The text was updated successfully, but these errors were encountered: