opencv版本:4.5.1,目录结构如下所示:
其中的build\x64目录中,包含两个VC版本的编译后的库文件,即VC14和VC15。本文安装的编译器采用的是VC15。下面还需要配置环境变量,首先配置PATH环境变量,将 F:\opencv\build\x64\vc15\bin 添加到PATH环境变量中
vs2019设置
配置完需要重启vs2019
demo
#include <opencv2\opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char** argv) {
Mat src = imread("C:/Users/Dell/Pictures/faces.jpg");
imshow("input", src);
waitKey(0);
destroyAllWindows();
return 0;
}