OpenCV3程序转到OpenCV4编译的问题

error: ‘CV_INTER_LINEAR’ was not declared in this scope
OpenCV4部分取消了CV_前缀
解决方法很简单,就是找到报错的文件,报错的变量修改适配 OpenCV4 中的变量。

CV_INTER_LINEAR  修改为 cv::INTER_LINEAR

或者,添加头文件

#include

error: ‘CV_RANSAC’ was not declared in this scope

CV_RANSAC  修改为 cv::RANSAC

error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope

CV_WINDOW_AUTOSIZE  修改为 cv::WINDOW_AUTOSIZE

或者,添加头文件

#include 

error: ‘CV_GRAY2RGB’ was not declared in this scope

#include 

报错 fatal error: opencv/cv.h: No such file or directory
将报错文件包含的头文件进行修改:

#include 

修改为:

#include 

fatal error: opencv/highgui.h: No such file or directory

报错文件包含的头文件进行修改:

#include 

修改为:

#include 

error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope

将报错文件包含的头文件进行修改:

CV_LOAD_IMAGE_GRAYSCALE

修改为:

cv::IMREAD_GRAYSCALE

error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope

CV_LOAD_IMAGE_COLOR

修改为:

cv::IMREAD_COLOR

你可能感兴趣的:(ROS,ros)