1.安装opencv,添加bin到系统环境变量,重启之后生效
2.在vs中任意创建控制台应用程序工程,添加依赖库文件
3.添加包含目录和库目录
cv: hello world
#include "opencv2/opencv.hpp"
using namespace cv;
int main(void)
{ char *fn = "D:\opencv\sources\samples\data\lena.jpg";
Mat image = imread(fn);
imshow("Hello,world!",image);
waitkey(0);
}