目录
有错误或没说清楚的地方欢迎评论指正,我会修改的,谢谢大家
报错内容
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.2.0) ../modules/calib3d/src/calibration.cpp:259: error: (-5:Bad argument) Input argument is not a valid matrix in function 'cvRodrigues2'
已放弃 (核心已转储)
解决参考
If you use OpenCV 4, lines 1093-1096 in kinect2_bridge/src/kinect2_calibration.cpp get macro'ed out, so you'll need to add a line for OpenCV 4 (same call signature as the one for OpenCV 3).
具体步骤
在kinect2_calibration.cpp的1096行添加一段
#elif CV_MAJOR_VERSION == 4
cv::solvePnPRansac(board, points[index], cameraMatrix, distortion, rvec, translation, false, 300, 0.05, 0.99, cv::noArray(), cv::SOLVEPNP_ITERATIVE);
保存后再把自己的工作空间编译一下。
cd ~/catkin_RealSense_ws/src/
catkin_make
编译成功