【UR5机械臂Moveit避障】【番外】kinectv2内参标定depth时报错Input argument is not a valid matrix in function ‘cvRodrigue

目录

有错误或没说清楚的地方欢迎评论指正,我会修改的,谢谢大家

报错内容

解决参考

具体步骤


有错误或没说清楚的地方欢迎评论指正,我会修改的,谢谢大家

报错内容

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'

已放弃 (核心已转储)

解决参考

Error while calibrating depth · Issue #497 · code-iai/iai_kinect2 · GitHubI have a rather peculiar setup here, which is Ubuntu 18.04, running a ROS melodic 1.14.2 and using OpenCV3.2 . I have to say that everything worked perfectly till now. I am facing this error while trying to calibrate depth image (rosrun ...icon-default.png?t=N7T8https://github.com/code-iai/iai_kinect2/issues/497里面提到下面这段话

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

编译成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值