这是运行高翔slambook2的代码出现的错误

terminate called after throwing an instance of ‘cv::Exception’
what(): OpenCV(3.4.15) /home/diyu/opencv-3.4.15/modules/imgproc/src/resize.cpp:4051: error: (-215:Assertion failed) !ssize.empty() in function ‘resize’
已放弃 (核心已转储)

问题原因就在于代码中的文件路径找不到,所以出现为空的问题。

比如我这里以slamboo5/ch8 中的代码示例

如图,代码中文件路径使用相对路径,这里即图片与代码在一个文件夹下


但是我们编译这种cmake文件时习惯新建build文件,这样我们生成的目标文件(可运行文件)就在build文件夹下了。

所以,有两种方法

  1. 要么选择修改代码中的文件路径。这里的话就是将 ./ 修改成 ../
  2. 要么将build文件下生成的可运行文件(目标文件)移到上级目录

这里展示第2种

这里是在新建build文件夹下编译的,编译生成了两个目标文件

然后,将build中生成的目标文件移到上级目录


然后在上级目录中打开终端运行即可。

【已解决】terminate called after throwing an instance of ‘cv::Exception‘,已放弃 (核心已转储)相关推荐

  1. 《视觉SLAM 十四讲》第五讲 实践:拼接点云-编译遇到的terminate called after throwing an instance of 'pcl::IOException问题及解决方法

    <视觉SLAM 十四讲>第五讲 实践:拼接点云-编译遇到的terminate called after throwing an instance of 'pcl::IOException问 ...

  2. terminate called after throwing an instance of ‘stdbad_alloc‘问题原因与解决

    terminate called after throwing an instance of 'std::bad_alloc'问题原因与解决 当做一个QT程序调试如下部分代码时,我想将此处部分代码简化 ...

  3. Centos7 编译C++项目错误解决 : terminate called after throwing an instance of ‘std::regex_error‘

    文章目录 1 问题原因 1.1 确保编译器支持std::regex 2 解决方法 3 Centos7升级gcc 3.1 安装centos-release-scl 3.2 安装devtoolset 3. ...

  4. 报错日志1:terminate called after throwing an instance of ‘ros::TimeNotInitializedException‘——ROS项目报错

    今日报错(渔舟唱晚BGM起): terminate called after throwing an instance of 'ros::TimeNotInitializedException'wha ...

  5. XGB模型训练报错 terminate called after throwing an instance of ‘std::bad_alloc‘ what()

    背景:需要做XGB模型增量训练,但是因为一些原因没有得到原来的XGB模型,只有dump文件. XGB模型的dump文件是它的树结构存储为一个相对人类好理解的模型文件,但并不能被重新加载进XGB进行增量 ...

  6. terminate called after throwing an instance of ‘YAML::TypedBadConversion<int>‘ what(): bad conver

    terminate called after throwing an instance of 'YAML::TypedBadConversion<int>'what(): bad conv ...

  7. 【Debug记录】terminate called after throwing an instance of ‘xxxxxx‘

    项目场景: 问题描述 terminate called after throwing an instance of 'xxxxxx' 编译没问题,但运行出错 原因1:内存不足 解决方案: 查看当前所有 ...

  8. terminate called after throwing an instance of ‘std::runtime_error‘ what(): locale::facet::_S_cre

    在运行程序时出错: terminate called after throwing an instance of 'std::runtime_error'   what():  locale::fac ...

  9. 报错信息 terminate called after throwing an instance of ‘std::cad_alloc‘ what():std::bad_alloc

    最近做了一道bfs算法的程序题 输入测试数据后卡在运行框中 然后会产生一个错误信息 第一次见到这样的报错于是记录一下解决过程 terminate called after throwing an in ...

最新文章

  1. splice方法_JavaScript数组常用方法
  2. var_export
  3. sql server 2008 r2 没有维护计划_坚果R2发布,骁龙865+1亿像素+90Hz,4499元起
  4. hashmap实现倒排索引——查询多个单词出现在多个句子中
  5. 对于PHP框架的简单认识
  6. SQL注入——基于联合查询的字符型GET注入(三)
  7. 在JDK 11中启动单文件源代码程序
  8. java字符串底层实现_「JAVA」细述合理创建字符串,分析字符串的底层存储,你不该错过...
  9. css compressor java_利用YUI Compressor压缩JS/CSS之终极秘籍
  10. python中的import
  11. 微星主板黑苹果_黑苹果安装教程:准备磁盘+主板BIOS设置——墨涩网
  12. 【ELK解决方案】ELK集群+RabbitMQ部署方案以及快速开发RabbitMQ生产者与消费者基础服务...
  13. 【Nightingale (夜莺)监控系统安装配置】
  14. 什么是英特尔® Edison 模块?
  15. 基于babylon3D模型研究3D骨骼动画(1)
  16. Sniffing_Spoofing Report
  17. 下载微信账单用于分析
  18. CRIE: An automated analyzer for Chinese texts翻译
  19. 【数学建模笔记 07】数学建模的对策论
  20. DS1302基本的读写

热门文章

  1. Leetcode刷题笔记——剑指offer II (六)【图】
  2. Android self_adaption of screen
  3. 室内设计师面试技巧有哪些?
  4. 单片机实验三(D/A+DMA实验)
  5. (一)自学java必备技能开头篇:下载哔哩哔哩文件改名
  6. 关于Linux中的apt-get的相关操作及原理
  7. python3中zip函数_用python实现矩阵转置,python3 中zip()函数
  8. wince版千千静听出炉
  9. Swing 美化包-JTattoo
  10. BIOS实战之Memory配置