“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 "opencv2/imgproc/imgproc_c.h"

4.‘CV_RGB2GRAY’ was not declared in this scope

#include<opencv2/imgproc/types_c.h>

5.‘CV_MINMAX’ was not declared in this scope

#include<opencv2/opencv.hpp>

6…‘CV_RGB2GRAY ’ was not declared in this scope

#include <opencv2/highgui/highgui_c.h>

7.‘CV_GRAY2RGB’ was not declared in this scope

#include<opencv2/imgproc/types_c.h>

8.CV_ADAPTIVE_THRESH_MEAN_C’ was not declared in this scope

#include <opencv2/calib3d/calib3d_c.h>

9.‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope

#include"opencv2/imgcodecs/legacy/constants_c.h"

版权声明:本文为weixin_49353816原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。