How to compute basis of nullspace with Eigen library?

后端 未结 3 1123
孤街浪徒
孤街浪徒 2021-01-22 10:10

How to compute basis of nullspace of a matrix with Eigen library?

I tried to find explicit function name to compute null basis and also

3条回答
  •  无人共我
    2021-01-22 10:25

    Alternative: Use OpenCV to calculate null space:

    `
    cv::Mat EpipolarConstraint::getNullSpace(cv::Mat p)
    {
        cv::SVD svd = cv::SVD(p, cv::SVD::FULL_UV);
        cv::Mat vt_ = svd.vt;
        int i;
        for (i = 1; i <= 3; i++)
        {
            if (p.at(i - 1, i - 1) == 0)
            {
                break;
            }
        }
        cv::Mat result = vt_(cv::Rect(0, i-1, p.cols, vt_.rows-i+1));
        cv::Mat result_t;
        cv::transpose(result, result_t);
        return result_t;
    }`
    

提交回复
热议问题