error: ‘CV_BGR2GRAY’ was not declared in this scope

原博客搬移到: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

posted @ 2020-08-23 15:10  cumtchw  阅读(1773)  评论(0编辑  收藏  举报