OpenCV error: ‘CV_BGR2GRAY’ was not declared in this scope错误

本人在学习OpenCV时按照书上的代码敲:

cvtColor(srcImage,grayImage,COLOR_BGR2GRAY );

这里遇到报错:

error: ‘CV_BGR2GRAY’ was not declared in this scope
     cvtColor(srcImage,grayImage,CV_BGR2GRAY );

一直不解,查了半天才发现是由于版本更新,CV_BGR2GRAY改为了COLOR_BGR2GRAY。

且所有都发生了变化需将CV改为COLOR。

发布了36 篇原创文章 · 获赞 7 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_41807801/article/details/90319265