error: declaration of 'cv::Mat R ' shadows a parameter
生活随笔
收集整理的这篇文章主要介绍了
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就会覆盖原有变量,因而报错。
转载于:https://www.cnblogs.com/defe-learn/p/6839368.html
总结
以上是生活随笔为你收集整理的error: declaration of 'cv::Mat R ' shadows a parameter的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 【转载】PHP面向对象(OOP)编程入门
- 下一篇: 软件规格说明书