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)编程入门
- 下一篇: Windows Mobile设备操作演示