Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SolvePnPRansac, all axes look great except for one.

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 possible be doing to make this happen?

    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_;
    //points3D_t0
    cv::solvePnPRansac(points3D_t0, points_left_t1, intrinsic_matrix, distCoeffs, rvec, translation_stereo,
        useExtrinsicGuess, iterationsCount, reprojectionError, confidence,
        inliers, flags);

SolvePnPRansac, all axes look great except for one.

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 possible possibly be doing wrong to make this happen?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_;
    //points3D_t0
    cv::solvePnPRansac(points3D_t0, points_left_t1, intrinsic_matrix, distCoeffs, rvec, translation_stereo,
        useExtrinsicGuess, iterationsCount, reprojectionError, confidence,
        inliers, flags);