C ++ Opencv installation guide super detailed illustration Vs2015 / 2017/2019 (C ++) Binding VisualStduio

C ++ Opencv C ++ installation guide Configuration Tutorial ultra detailed illustration Vs2015 / 2017/2019 (C ++ ) opencv binding VisualStduio
Vs of the configuration opencv opencv configuration Tutorial

安装Open-cv with VisualStudio(c++)

The path to the system comprising OpenCV

1. Turn on this computer

2. Add the system environment variable to open the computer!

Then right after that this computer click Properties to open the Select - Advanced System Settings - environment variables in the system variable path below, click "Edit"

Then click "New" to add a new environment variable. Copy and paste the OpenCV package vc15 \ bin folder path

Copy the following path

After pressing pasted, add OK, and then click OK again to exit the Environment Variables dialog box.


3. Open Visual Studio. The project will create a new empty console application project using Visual C ++. Be empty project and complete.

In source add a new .cpp file within the file . This will open the newly created editor cpp file.

Type the following code in the editor, and then save the source file. You can copy and paste the entire code from below.

#include<opencv2/opencv.hpp>
#include<iostream>
using namespace std;
using namespace cv;
int main()
{
  Mat img = imread("lena.jpg");//此处的文件需要与源文件同目录!!
  namedWindow("image", WINDOW_NORMAL);
  imshow("image", img);
  waitKey(0);
  return 0;
}

4. OpenCV included in Visual Studio

First open the Configuration Manager here to X64

Right after the confirmation the project name - property

Copy the include path opencv to the Additional include directories and then click Apply

Select - Connectors - General added vc15 \ lib directory to the Additional Library Directories

Then click Apply, and then select the input directory

Click Edit in the Additional Dependencies, and then click OK in the blank, enter opencv_world420d.lib

再点击应用

最后选择高级 - 目标计算机 改为MachineX64 应用

全部应用后 退出VisualStuio 重新打开项目运行 即可

Guess you like

Origin www.cnblogs.com/pandaa/p/12146734.html