error: declaration of 'cv::Mat R ' shadows a parameter
Posted defe_feath
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了error: declaration of 'cv::Mat R ' shadows a parameter相关的知识,希望对你有一定的参考价值。
变量被覆盖。
例:
void pose_estimation_2d2d::_pose_estimation_2d2d(const vector<KeyPoint> &v_keypoints_1, const vector<KeyPoint> &v_keypoints_2, const vector<DMatch> v_goodmatches, const Mat &K, Mat &R, Mat &t)
{
......
cv::Mat_<double> R = svd.u * W * svd.vt;
......
}
函数的参数列表中已经有变量R了,在函数体内新定义一个R就会覆盖原有变量,因而报错。
以上是关于error: declaration of 'cv::Mat R ' shadows a parameter的主要内容,如果未能解决你的问题,请参考以下文章