问题描述及原因分析

Opencv在更新到 新版本 后,在运行有些 旧版本 的代码时会出现此类情况

解决方案:

error: ‘CV_AA’ was not declared in this scope

在头文件中添加 #include <opencv2/imgproc/imgproc_c.h>


error: ‘CV_CALIB_CB_ADAPTIVE_THRESH’ was not declared in this scope

在头文件中添加 #include <opencv2/calib3d/calib3d_c.h>


error: ‘CV_GRAY2BGR’ was not declared in this scope

在头文件中添加 #include <opencv2/imgproc/types_c.h>


error: ‘CV_FONT_HERSHEY_SIMPLEX’ was not declared in this scope

Use cv::FONT_HERSHEY_SIMPLEX instead of CV_FONT_HERSHEY_SIMPLEX

Logo

加入「COC·上海城市开发者社区」,成就更好的自己!

更多推荐