使用opencv4运行opencv3代码需要注意问题

  1. CV_FOURCC
    OpenCV 4 (C++) 解决 “error: ‘CV_FOURCC’ was not declared in this scope”
    在 OpenCV 3 中我们使用 CV_FOURCC 来标识 codec1,例如:
writer.open("test.avi", CV_FOURCC('M', 'J', 'P', 'G'), fps, size);

在 OpenCV 4 (4.5.4-dev) 中, CV_FOURCC 已经被 VideoWriter 的函数 fourcc 所取代;OpenCV4 中 fourcc 的用法:

writer.open("test.avi", cv::VideoWriter::fourcc('M', 'J', 'P', 'G'), fps, size);

猜你喜欢

转载自blog.csdn.net/zfjBIT/article/details/128091906
今日推荐