首页 > 技术文章 > error: ‘CV_BGR2GRAY’ was not declared in this scope

cumtchw 2020-08-23 15:10 原文

原博客搬移到:https://blog.csdn.net/u013171226/article/details/108062603

 

 

某项目中opencv版本由opencv3更换为opencv4之后,之前的代码编译出错,

error: ‘CV_BGR2GRAY’ was not declared in this scope

这是由于版本更新,宏定义发生了改变。

修改方法为:将CV_BGR2GRAY改为cv::COLOR_BGR2GRAY

推荐阅读