ROS相关

ROS相关

涉及ROS1的安装,搭建,编译,使用等相关问题
ROS2相关

ROS2相关

涉及ROS2的安装,搭建,编译,使用等相关问题
Turtlebot

Turtlebot

涉及Turtlebot,Turbot,Turbot3等相关问题
二次开发

二次开发

涉及ROS功能包的外包开发等相关问题
Linux系统相关

Linux系统相关

涉及Linux的系统安装,软件安装等相关问题
嵌入式开发板

嵌入式开发板

涉及树莓派,TX2,Xavier,Nano等相关问题
企业招聘

企业招聘

涉及企业招聘、职位等相关信息
创客智造官网

创客智造官网

创客智造官网
创客智造站务

创客智造站务

ros_arduino_bridge成功了,打开控制键盘节点出现等待订阅者连接cmd_vel

回复

yb 发起了问题 • 1 人关注 • 0 个回复 • 73 次浏览 • 2024-11-18 17:54 • 来自相关话题

cartographer提供的保存地图方式和mapserver保存出来的pgm地图是不是实际格式是不一样呢?

回复

yzzzzz 发起了问题 • 1 人关注 • 0 个回复 • 91 次浏览 • 2024-11-13 01:13 • 来自相关话题

rviz2-is-not-working-in-ros2-jazzy/rviz2不能再jazzy上启动

回复

ROS2相关ncnynl 发起了问题 • 1 人关注 • 0 个回复 • 332 次浏览 • 2024-07-09 09:00 • 来自相关话题

网站专栏内容制作推荐跟贴

回复

ncnynl 发起了问题 • 1 人关注 • 0 个回复 • 1326 次浏览 • 2023-05-02 11:48 • 来自相关话题

编译报错不知道为什么

回复

XLY 发起了问题 • 1 人关注 • 0 个回复 • 1788 次浏览 • 2021-07-10 15:51 • 来自相关话题

ImportError: No module named em

回复

ddwy 发起了问题 • 1 人关注 • 0 个回复 • 2058 次浏览 • 2021-05-27 09:41 • 来自相关话题

Rgbdslam v 2 安装最后catkin make卡在百分之58了然后电脑卡了是什么原因

回复

发起了问题 • 1 人关注 • 0 个回复 • 1882 次浏览 • 2020-12-13 19:22 • 来自相关话题

error:pip install virtualenv

回复

ddwy 发起了问题 • 1 人关注 • 0 个回复 • 1777 次浏览 • 2020-10-12 10:24 • 来自相关话题

源码安装vins-mono算法问题整理(ROS Melodic + opencv 4.1.1)

lalala 发表了文章 • 0 个评论 • 9023 次浏览 • 2020-08-28 13:12 • 来自相关话题

测试环境:Jetson Xavier NX+ Jetpack4.4 + Ubuntu 1804 + ROS Melodic + opencv 4.1.1
 
问题一
 编译时报错 error: ‘CV_GRAY2RGB’ was not declared in this scope 等
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In constructor ‘camodocal::Chessboard::Chessboard(cv::Size, cv::Mat&)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:20:38: error: ‘CV_GRAY2BGR’ was not declared in this scope
cv::cvtColor(image, mSketch, CV_GRAY2BGR);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:26:37: error: ‘CV_BGR2GRAY’ was not declared in this scope
cv::cvtColor(image, mImage, CV_BGR2GRAY);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘bool camodocal::Chessboard::findChessboardCornersImproved(const cv::Mat&, const Size&, std::vector<cv::Point_<float> >&, int)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:150:43: error: ‘CV_BGR2GRAY’ was not declared in this scope
cv::cvtColor(image, norm_img, CV_BGR2GRAY);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:207:67: error: ‘CV_THRESH_BINARY’ was not declared in this scope
cv::threshold(img, thresh_img, thresh_level, 255, CV_THRESH_BINARY);
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In constructor ‘camodocal::Chessboard::Chessboard(cv::Size, cv::Mat&)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:20:38: error: ‘CV_GRAY2BGR’ was not declared in this scope
cv::cvtColor(image, mSketch, CV_GRAY2BGR);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:26:37: error: ‘CV_BGR2GRAY’ was not declared in this scope
cv::cvtColor(image, mImage, CV_BGR2GRAY);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:215:57: error: ‘CV_SHAPE_CROSS’ was not declared in this scope
cv::Mat kernel1 = cv::getStructuringElement(CV_SHAPE_CROSS, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘bool camodocal::Chessboard::findChessboardCornersImproved(const cv::Mat&, const Size&, std::vector<cv::Point_<float> >&, int)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:150:43: error: ‘CV_BGR2GRAY’ was not declared in this scope
cv::cvtColor(image, norm_img, CV_BGR2GRAY);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:215:57: note: suggested alternative: ‘CV_WRAP_AS’
cv::Mat kernel1 = cv::getStructuringElement(CV_SHAPE_CROSS, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~~
CV_WRAP_AS
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:216:57: error: ‘CV_SHAPE_RECT’ was not declared in this scope
cv::Mat kernel2 = cv::getStructuringElement(CV_SHAPE_RECT, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:320:43: error: ‘CV_TERMCRIT_EPS’ was not declared in this scope
cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
^~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:207:67: error: ‘CV_THRESH_BINARY’ was not declared in this scope
cv::threshold(img, thresh_img, thresh_level, 255, CV_THRESH_BINARY);
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:320:61: error: ‘CV_TERMCRIT_ITER’ was not declared in this scope
cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:215:57: error: ‘CV_SHAPE_CROSS’ was not declared in this scope
cv::Mat kernel1 = cv::getStructuringElement(CV_SHAPE_CROSS, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:215:57: note: suggested alternative: ‘CV_WRAP_AS’
cv::Mat kernel1 = cv::getStructuringElement(CV_SHAPE_CROSS, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~~
CV_WRAP_AS
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:216:57: error: ‘CV_SHAPE_RECT’ was not declared in this scope
cv::Mat kernel2 = cv::getStructuringElement(CV_SHAPE_RECT, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:320:43: error: ‘CV_TERMCRIT_EPS’ was not declared in this scope
cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
^~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘void camodocal::Chessboard::generateQuads(std::vector<boost::shared_ptr<camodocal::ChessboardQuad> >&, cv::Mat&, int, int, bool)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1175:50: error: ‘CV_RETR_CCOMP’ was not declared in this scope
cv::findContours(image, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:320:61: error: ‘CV_TERMCRIT_ITER’ was not declared in this scope
cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1175:65: error: ‘CV_CHAIN_APPROX_SIMPLE’ was not declared in this scope
cv::findContours(image, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘void camodocal::Chessboard::generateQuads(std::vector<boost::shared_ptr<camodocal::ChessboardQuad> >&, cv::Mat&, int, int, bool)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1175:50: error: ‘CV_RETR_CCOMP’ was not declared in this scope
cv::findContours(image, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1175:65: error: ‘CV_CHAIN_APPROX_SIMPLE’ was not declared in this scope
cv::findContours(image, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘bool camodocal::Chessboard::checkChessboard(const cv::Mat&, cv::Size) const’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1586:72: error: ‘CV_THRESH_BINARY’ was not declared in this scope
cv::threshold(white, thresh, threshLevel + blackWhiteGap, 255, CV_THRESH_BINARY);
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1592:55: error: ‘CV_RETR_CCOMP’ was not declared in this scope
cv::findContours(thresh, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1592:70: error: ‘CV_CHAIN_APPROX_SIMPLE’ was not declared in this scope
cv::findContours(thresh, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘bool camodocal::Chessboard::checkChessboard(const cv::Mat&, cv::Size) const’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1586:72: error: ‘CV_THRESH_BINARY’ was not declared in this scope
cv::threshold(white, thresh, threshLevel + blackWhiteGap, 255, CV_THRESH_BINARY);
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1597:56: error: ‘CV_THRESH_BINARY_INV’ was not declared in this scope
cv::threshold(black, thresh, threshLevel, 255, CV_THRESH_BINARY_INV);
^~~~~~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1592:55: error: ‘CV_RETR_CCOMP’ was not declared in this scope
cv::findContours(thresh, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1592:70: error: ‘CV_CHAIN_APPROX_SIMPLE’ was not declared in this scope
cv::findContours(thresh, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1597:56: error: ‘CV_THRESH_BINARY_INV’ was not declared in this scope
cv::threshold(black, thresh, threshLevel, 255, CV_THRESH_BINARY_INV);

/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/calib/CameraCalibration.cc: In member function ‘void camodocal::CameraCalibration::drawResults(std::vector<cv::Mat>&) const’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/calib/CameraCalibration.cc:236:40: error: ‘CV_GRAY2RGB’ was not declared in this scope
cv::cvtColor(image, image, CV_GRAY2RGB);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/calib/CameraCalibration.cc:236:40: note: suggested alternative: ‘CV_GRAPH’
cv::cvtColor(image, image, CV_GRAY2RGB);
^~~~~~~~~~~
CV_GRAPH
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/calib/CameraCalibration.cc:254:37: error: ‘CV_AA’ was not declared in this scope
5, green, 2, CV_AA, drawShiftBits);
^~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/calib/CameraCalibration.cc:254:37: note: suggested alternative: ‘CV_AVX’
5, green, 2, CV_AA, drawShiftBits);
^~~~~
CV_AVX

解决方法
 
在报错文件上添加头文件 #include <opencv2/imgproc/imgproc_c.h>单独遇到CV_AA的报错时,也可以将 CV_AA 改为 cv::LINE_AA

问题二
 
编译时报错 error: ‘CV_CALIB_CB_ADAPTIVE_THRESH’ was not declared in this scope 、error: ‘CV_CALIB_CB_NORMALIZE_IMAGE’ was not declared in this scope、error: ‘CV_CALIB_CB_FILTER_QUADS’ was not declared in this scope 和 error: ‘CV_CALIB_CB_FAST_CHECK’ was not declared in this scope

解决方法
 
将CV_CALIB_CB_ADAPTIVE_THRESH、CV_CALIB_CB_NORMALIZE_IMAGE、CV_CALIB_CB_FILTER_QUADS和CV_CALIB_CB_FAST_CHECK修改为 cv::CALIB_CB_ADAPTIVE_THRESH 、 cv::CALIB_CB_NORMALIZE_IMAGE 、cv::CALIB_CB_FILTER_QUADS 和cv::CALIB_CB_FAST_CHECK
 
问题三
 
编译时报错 error: ‘CV_RGB2GRAY’ was not declared in this scope
/home/ubuntu/catkin_ws/src/VINS-Mono/pose_graph/src/ThirdParty/DVision/BRIEF.cpp:53:32: error: ‘CV_RGB2GRAY’ was not declared in this scope cv::cvtColor(image, aux, CV_RGB2GRAY);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/pose_graph/src/ThirdParty/DVision/BRIEF.cpp:53:32: note: suggested alternative: ‘CV_RGB’ cv::cvtColor(image, aux, CV_RGB2GRAY);

解决方法
 
在报错文件上添加头文件 #include<opencv2/imgproc/types_c.h>

问题四
 
编译时遇到报错 error: ‘CV_FONT_HERSHEY_SIMPLEX’ was not declared in this scope
 
解决方法
 
将报错文件上的 CV_FONT_HERSHEY_SIMPLEX 参数改为 cv::FONT_HERSHEY_SIMPLEX 查看全部
测试环境:Jetson Xavier NX+ Jetpack4.4 + Ubuntu 1804 + ROS Melodic + opencv 4.1.1
 
问题一
  •  编译时报错 error: ‘CV_GRAY2RGB’ was not declared in this scope 等

/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In constructor ‘camodocal::Chessboard::Chessboard(cv::Size, cv::Mat&)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:20:38: error: ‘CV_GRAY2BGR’ was not declared in this scope
cv::cvtColor(image, mSketch, CV_GRAY2BGR);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:26:37: error: ‘CV_BGR2GRAY’ was not declared in this scope
cv::cvtColor(image, mImage, CV_BGR2GRAY);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘bool camodocal::Chessboard::findChessboardCornersImproved(const cv::Mat&, const Size&, std::vector<cv::Point_<float> >&, int)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:150:43: error: ‘CV_BGR2GRAY’ was not declared in this scope
cv::cvtColor(image, norm_img, CV_BGR2GRAY);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:207:67: error: ‘CV_THRESH_BINARY’ was not declared in this scope
cv::threshold(img, thresh_img, thresh_level, 255, CV_THRESH_BINARY);
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In constructor ‘camodocal::Chessboard::Chessboard(cv::Size, cv::Mat&)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:20:38: error: ‘CV_GRAY2BGR’ was not declared in this scope
cv::cvtColor(image, mSketch, CV_GRAY2BGR);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:26:37: error: ‘CV_BGR2GRAY’ was not declared in this scope
cv::cvtColor(image, mImage, CV_BGR2GRAY);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:215:57: error: ‘CV_SHAPE_CROSS’ was not declared in this scope
cv::Mat kernel1 = cv::getStructuringElement(CV_SHAPE_CROSS, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘bool camodocal::Chessboard::findChessboardCornersImproved(const cv::Mat&, const Size&, std::vector<cv::Point_<float> >&, int)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:150:43: error: ‘CV_BGR2GRAY’ was not declared in this scope
cv::cvtColor(image, norm_img, CV_BGR2GRAY);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:215:57: note: suggested alternative: ‘CV_WRAP_AS’
cv::Mat kernel1 = cv::getStructuringElement(CV_SHAPE_CROSS, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~~
CV_WRAP_AS
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:216:57: error: ‘CV_SHAPE_RECT’ was not declared in this scope
cv::Mat kernel2 = cv::getStructuringElement(CV_SHAPE_RECT, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:320:43: error: ‘CV_TERMCRIT_EPS’ was not declared in this scope
cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
^~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:207:67: error: ‘CV_THRESH_BINARY’ was not declared in this scope
cv::threshold(img, thresh_img, thresh_level, 255, CV_THRESH_BINARY);
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:320:61: error: ‘CV_TERMCRIT_ITER’ was not declared in this scope
cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:215:57: error: ‘CV_SHAPE_CROSS’ was not declared in this scope
cv::Mat kernel1 = cv::getStructuringElement(CV_SHAPE_CROSS, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:215:57: note: suggested alternative: ‘CV_WRAP_AS’
cv::Mat kernel1 = cv::getStructuringElement(CV_SHAPE_CROSS, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~~
CV_WRAP_AS
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:216:57: error: ‘CV_SHAPE_RECT’ was not declared in this scope
cv::Mat kernel2 = cv::getStructuringElement(CV_SHAPE_RECT, cv::Size(3,3), cv::Point(1,1));
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:320:43: error: ‘CV_TERMCRIT_EPS’ was not declared in this scope
cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
^~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘void camodocal::Chessboard::generateQuads(std::vector<boost::shared_ptr<camodocal::ChessboardQuad> >&, cv::Mat&, int, int, bool)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1175:50: error: ‘CV_RETR_CCOMP’ was not declared in this scope
cv::findContours(image, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:320:61: error: ‘CV_TERMCRIT_ITER’ was not declared in this scope
cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1175:65: error: ‘CV_CHAIN_APPROX_SIMPLE’ was not declared in this scope
cv::findContours(image, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘void camodocal::Chessboard::generateQuads(std::vector<boost::shared_ptr<camodocal::ChessboardQuad> >&, cv::Mat&, int, int, bool)’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1175:50: error: ‘CV_RETR_CCOMP’ was not declared in this scope
cv::findContours(image, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1175:65: error: ‘CV_CHAIN_APPROX_SIMPLE’ was not declared in this scope
cv::findContours(image, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘bool camodocal::Chessboard::checkChessboard(const cv::Mat&, cv::Size) const’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1586:72: error: ‘CV_THRESH_BINARY’ was not declared in this scope
cv::threshold(white, thresh, threshLevel + blackWhiteGap, 255, CV_THRESH_BINARY);
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1592:55: error: ‘CV_RETR_CCOMP’ was not declared in this scope
cv::findContours(thresh, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1592:70: error: ‘CV_CHAIN_APPROX_SIMPLE’ was not declared in this scope
cv::findContours(thresh, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc: In member function ‘bool camodocal::Chessboard::checkChessboard(const cv::Mat&, cv::Size) const’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1586:72: error: ‘CV_THRESH_BINARY’ was not declared in this scope
cv::threshold(white, thresh, threshLevel + blackWhiteGap, 255, CV_THRESH_BINARY);
^~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1597:56: error: ‘CV_THRESH_BINARY_INV’ was not declared in this scope
cv::threshold(black, thresh, threshLevel, 255, CV_THRESH_BINARY_INV);
^~~~~~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1592:55: error: ‘CV_RETR_CCOMP’ was not declared in this scope
cv::findContours(thresh, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1592:70: error: ‘CV_CHAIN_APPROX_SIMPLE’ was not declared in this scope
cv::findContours(thresh, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE);
^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/chessboard/Chessboard.cc:1597:56: error: ‘CV_THRESH_BINARY_INV’ was not declared in this scope
cv::threshold(black, thresh, threshLevel, 255, CV_THRESH_BINARY_INV);

/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/calib/CameraCalibration.cc: In member function ‘void camodocal::CameraCalibration::drawResults(std::vector<cv::Mat>&) const’:
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/calib/CameraCalibration.cc:236:40: error: ‘CV_GRAY2RGB’ was not declared in this scope
cv::cvtColor(image, image, CV_GRAY2RGB);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/calib/CameraCalibration.cc:236:40: note: suggested alternative: ‘CV_GRAPH’
cv::cvtColor(image, image, CV_GRAY2RGB);
^~~~~~~~~~~
CV_GRAPH
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/calib/CameraCalibration.cc:254:37: error: ‘CV_AA’ was not declared in this scope
5, green, 2, CV_AA, drawShiftBits);
^~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/camera_model/src/calib/CameraCalibration.cc:254:37: note: suggested alternative: ‘CV_AVX’
5, green, 2, CV_AA, drawShiftBits);
^~~~~
CV_AVX

解决方法
 
  • 在报错文件上添加头文件 #include <opencv2/imgproc/imgproc_c.h>
  • 单独遇到CV_AA的报错时,也可以将 CV_AA 改为 cv::LINE_AA


问题二
 
  • 编译时报错 error: ‘CV_CALIB_CB_ADAPTIVE_THRESH’ was not declared in this scope 、error: ‘CV_CALIB_CB_NORMALIZE_IMAGE’ was not declared in this scope、error: ‘CV_CALIB_CB_FILTER_QUADS’ was not declared in this scope 和 error: ‘CV_CALIB_CB_FAST_CHECK’ was not declared in this scope


解决方法
 
  • 将CV_CALIB_CB_ADAPTIVE_THRESH、CV_CALIB_CB_NORMALIZE_IMAGE、CV_CALIB_CB_FILTER_QUADS和CV_CALIB_CB_FAST_CHECK修改为 cv::CALIB_CB_ADAPTIVE_THRESH 、 cv::CALIB_CB_NORMALIZE_IMAGE 、cv::CALIB_CB_FILTER_QUADS 和cv::CALIB_CB_FAST_CHECK

 
问题三
 
  • 编译时报错 error: ‘CV_RGB2GRAY’ was not declared in this scope

/home/ubuntu/catkin_ws/src/VINS-Mono/pose_graph/src/ThirdParty/DVision/BRIEF.cpp:53:32: error: ‘CV_RGB2GRAY’ was not declared in this scope cv::cvtColor(image, aux, CV_RGB2GRAY);
^~~~~~~~~~~
/home/ubuntu/catkin_ws/src/VINS-Mono/pose_graph/src/ThirdParty/DVision/BRIEF.cpp:53:32: note: suggested alternative: ‘CV_RGB’ cv::cvtColor(image, aux, CV_RGB2GRAY);


解决方法
 
  • 在报错文件上添加头文件 #include<opencv2/imgproc/types_c.h>


问题四
 
  • 编译时遇到报错 error: ‘CV_FONT_HERSHEY_SIMPLEX’ was not declared in this scope

 
解决方法
 
  • 将报错文件上的 CV_FONT_HERSHEY_SIMPLEX 参数改为 cv::FONT_HERSHEY_SIMPLEX

amcl_params.yaml 定位参数

回复

ddwy 发起了问题 • 1 人关注 • 0 个回复 • 4017 次浏览 • 2019-11-01 09:48 • 来自相关话题