问题描述
“CV_XXX“was not declared in this scope
解决方法
在出错的程序里面添加相应的头文件即可
1.‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
#include "opencv2/imgcodecs/legacy/constants_c.h"
2.‘CV_FILLED’ was not declared in this scope
#include <opencv2/imgproc/imgproc_c.h>
3.‘CV_AA’ was not declared in this scope
#include

当在使用OpenCV库时遇到CV_XXX未声明的错误,解决方案通常是引入对应的头文件。例如,为了解决CV_LOAD_IMAGE_COLOR问题,需要包含opencv2/imgcodecs/legacy/constants_c.h;对于CV_FILLED和CV_AA,则需引入opencv2/imgproc/imgproc_c.h。其他如CV_RGB2GRAY对应opencv2/imgproc/types_c.h,CV_MINMAX对应opencv2/opencv.hpp等。按照错误提示引入正确的头文件可以解决这些定义未找到的错误。
最低0.47元/天 解锁文章
2196

被折叠的 条评论
为什么被折叠?



