opencv4和opencv3函数差异

1、cv::cvtColor(mat, mat, CV_BGR2RGB);

报错:CV_BGR2RGB未定义的标识符

处理方法:

添加头文件

#include "opencv2/imgproc/types_c.h"

 

2、VideoWriter writer("VideoTest0.avi", FOURCC('M', 'J', 'P', 'G'), rate, videoSize);
报错:FOURCC未定义的标识符
处理方法:
FOURCC改为VideoWriter::fourcc

3、line( dstImage, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(186,88,255), 1, CV_AA);

报错:CV_AA未定义的标识符

处理方法:

添加头文件

#include "opencv2/imgproc/imgproc_c.h"
 

你可能感兴趣的:(opencv)