SolvePnPRansac, all axes look great except for one.

asked 2018-07-29 12:25:41 -0500

antithing gravatar image

updated 2018-07-29 12:28:00 -0500

I am running solvePnPRansac on an image dataset, with 2d feature points and triangulated 3d landmark points. It runs great, and the results in rotation, and in the forward and side axes, look great. The Y axis though, is completely wrong.

I am testing the output against the ground truth from the data set, and it goes up where it should go down, and drifts off the ground truth very quickly. The other axes stay locked on.

this strikes me as strange, how can it be correct for the other axes, and wrong for one? Surely that is not possible?

What could i possibly be doing wrong to make this happen? opencv 4.0 pre, windows 10.

    cv::Mat inliers;
    cv::Mat rvec = cv::Mat::zeros(3, 1, CV_64FC1);      

    int iterationsCount = 500;        // number of Ransac iterations.
    float reprojectionError = 2.0; //2.0   // maximum allowed distance to consider it an inlier.
    float confidence = 0.95;          // RANSAC successful confidence.
    bool useExtrinsicGuess = false;
    int flags = cv::SOLVEPNP_ITERATIVE;

    int num_inliers_;
    cv::solvePnPRansac(points3D_t0, points_left_t1, intrinsic_matrix, distCoeffs, rvec, translation_stereo,
        useExtrinsicGuess, iterationsCount, reprojectionError, confidence,
        inliers, flags);
edit retag flag offensive close merge delete