QT5.9.0配置opencv

最近一直想用OPENCV处理写东西,可是按照各种教程CMAKE一直不能通过,所以,有点郁闷,今天有针对性的差了一些资料,果然应该是QT与编译过得opencv版本是否兼容的问题;
幸好,查到了加号君的这篇1,所以试了一下从github下载编译过得opencv3.4.1;
2.在环境变量中添加这一条:
高级系统设置->环境变量->Path中添加D:\OpenCV-MinGW-Build-OpenCV-3.4.1\bin
然后再.pro中加入文件路径,

INCLUDEPATH+=D:\OpenCV-MinGW-Build-OpenCV-3.4.1\include
             D:\OpenCV-MinGW-Build-OpenCV-3.4.1\include\opencv
             D:\OpenCV-MinGW-Build-OpenCV-3.4.1\include\opencv2
LIBS+=D:\OpenCV-MinGW-Build-OpenCV-3.4.1\bin\libopencv_*.dll

然后编译,发现Debug出错During startup program exited with code ,换Release也不行,因此专门针对它查了一下,发现了解决办法,然后把D:\OpenCV-MinGW-Build-OpenCV-3.4.1\bin中的.dll放到Build中,重新运行发现可以了!!!

你可能感兴趣的:(opencv,qt,计算机视觉)