openCV:terminate called after throwing an instance of ‘cv::Exception

视觉slam十四讲中第七讲中运行时提示错误,搜了一下网上的答案使用“Opencv“时遇到terminate called after throwing an i

视觉slam十四讲中第七讲中运行时提示错误,搜了一下网上的答案
使用“Opencv“时遇到terminate called after throwing an instance of ‘cv::Exception‘问题的解决方案

个人感觉解决办法比较粗暴

实际上这里的问题在于路径错误

查看一下路径发现两张图片的路径在ch7下,而终端命令在ch7/build下,因此解决办法有两种

  • 在ch7/build下运行
./orb_cv ../1.png ../2.png
  • 在ch7下
build/orb_cv 1.png 2.png

事实上高博的书上就是第二种写法

ps:编译问题看这个大佬SLAM十四讲编译全过程记录与错误与解决方案汇总