我最近在Ubuntu 18.04 LTS上从OpenCV3.3迁移到了最新版本的OpenCV4。我的安装存在一些永久性问题。当我遵循this安装教程时,我的安装没有出现任何错误。但是,每当我在项目中包含模块opencv2/highgui.hpp
时,都会遇到如下问题。当我点击this链接时,这似乎是由highgui.hpp引起的。
/home/arun/Documents/AutonomousLaneDetection/app/main.cpp: In function ‘int main(int, char**)’:
/home/arun/Documents/AutonomousLaneDetection/app/main.cpp:118:36: error: ‘CV_CAP_PROP_FRAME_WIDTH’ was not declared in this scope
int videoWidth = videofile.get(CV_CAP_PROP_FRAME_WIDTH);
^~~~~~~~~~~~~~~~~~~~~~~
/home/arun/Documents/AutonomousLaneDetection/app/main.cpp:119:37: error: ‘CV_CAP_PROP_FRAME_HEIGHT’ was not declared in this scope
int videoHeight = videofile.get(CV_CAP_PROP_FRAME_HEIGHT);
^~~~~~~~~~~~~~~~~~~~~~~~
/home/arun/Documents/AutonomousLaneDetection/app/main.cpp:123:27: error: ‘CV_FOURCC’ was not declared in this scope
CV_FOURCC('M', 'J', 'P', 'G'), 10,
^~~~~~~~~
/home/arun/Documents/AutonomousLaneDetection/app/main.cpp:123:27: note: suggested alternative: ‘CV_BLUR’
CV_FOURCC('M', 'J', 'P', 'G'), 10,
^~~~~~~~~
CV_BLUR