SVO相机标定环境配置相关问题

5 篇文章 0 订阅

报错:
terminate called after throwing an instance of ‘std::runtime_error’
what(): Frame: provided image has not the same size as the camera model or image is not grayscale

解决:
经过调试发现是这句的问题:

vo_->addImage(img, msg->header.stamp.toSec());

调用FrameHandlerMono::addImage函数(定义在frame_handler_mono.cpp中)

   其中,msg->header.stamp.toSec()可获取系统时间(以秒为单位)

   获取的图片img和转换的系统时间被传入函数addImage,addImage过程:

可是我刚刚把格式从mono改成了rgb格式,现在又要用这个函数。。。咋办
frame_handler_mono.cpp中:new_frame_.reset(new Frame(cam_, img.clone(), timestamp));
这句有问题。

先看报的错 第一种可能:provided image has not the same size as the camera model
提供的图像和camera的模型不一样。
https://github.com/uzh-rpg/rpg_svo/wiki/Camera-Calibration
http://wiki.ros.org/camera_calibration/Tutorials/MonocularCalibration
相机标定
使用第2个模型
rosdep报错:

// rosdep报错
rosdep install camera_calibration

ERROR: Rosdep cannot find all required resources to answer your query
Missing resource camera_calibration
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/mxy/leishen_ws/src
ROS path [2]=/opt/ros/melodic/share

是因为我没有安装camera_calibration。安完了又显示
Could not find a package configuration file provided by “image_geometry”
再安image_geometry
又提示没有stereo-msgs

sudo apt-get install ros-melodic-stereo-msgs
// 新的报错
CMake Error at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1947 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.65.1

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_python37

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.

发现自己没有python3.7,于是又安装python3.7(参考:https://blog.csdn.net/qq_25863199/article/details/91125794),切换python版本:

//查看当前版本
$ python --version

是Python 2.7.17

//切换python版本
sudo update-alternatives --config python

结果还是python3.6
继续解决问题:

$ sudo apt-get install python3.7
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
$ sudo update-alternatives --config python
$ python --version
Python 3.7.5!!耶

but!!!!!catkin_make需要的环境是python2.7…
所以,我先把环境变量改成python3.7后,再安装Boost,然后在切换2.7,再编译试试
不行。(最后参考软链接:https://blog.csdn.net/qq_42138662/article/details/105677869)

sudo ln -s libboost_python-py36.so libboost_python37.so
sudo ln -s libboost_python-py36.a libboost_python37.a
```成功。现在依赖的问题解决了,开始程序上报错了
CV_INTER_LINEAR' was not declared in this scope。解决方法 : cv::INTER_LINEAR 替换 CV_INTER_LINEAR
...............................................................................................................

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值