VS2017+opencv3.4配置
1、Opencv的下载和安装 https://opencv.org/releases.html 2. 安装路径 3. 注意文件 bin include x64 vc14对应VS2015,vc15对应VS2017 2、Opencv的配置 (1)配置Path系统环境变量 (2)VS2017中配置OpenCV 包含目录 + 库目录 + 链接器 1. 包含目录 配置: 2. 库目录 配置: 3. 链接器 配置: 这里不用被指动态链接库(.dll) 3、第一个简单的程序 在网上找的一个程序,过后要改进成自己的程序 #include "stdafx.h" //在VS2017中一些头文件都放在"stdafx.h"文件中 #include <iostream> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> using namespace cv; int main() { // 读入一张图片(游戏原画) Mat img = imread( "heibao.jpg" ); // 创建一个名为 "游戏原画"窗口 namedWindow( "游戏原画" ); // 在窗口中显示游戏原画 imshow( "游戏原画" , img); // 等待6000 ms后窗口自动关闭 waitKey( 6000 );