Welcome: Hunan Intelligent Applications Tecgnology CO.,ltd.-HNIAT.com
Language: Chinese ∷  English

Industry tracking

Detailed configuration of VS2019 and Opencv4.10

Configuration of VS2019 and Opencv4.10

Preparatory materials:

Vs2019 Community Edition (Free) Download Website

Opencv4.104.10 Download Website

First step

Install opencv

Double-click opencv just downloaded

Select the installation directory, I choose D: Program Files, which will automatically generate an opencv folder to store data.

After the installation is completed,

(1) Copy opencv_world410d.dll and opencv_world410.dll in the directory of D: Program Files opencv build x64 vc15 bin to C: Windows SysWOW64, and opencv_mpeg410_64.ffl to C: Windows System

(2) Configuring environment variables

Note: Because opencv4.1 deletes x86, only x64 needs to be configured.

Right-click on the desktop computer, then click on properties, enter the following interface, click Advanced Program Settings.

Click on environment variables

Add environment variables to the path. The directory I just installed is D: Program Files, so my environment variable is set to D: Program Files opencv build x64 vc15 bin.

Step 2 Installation of vs2019

Double-click the installation package just downloaded

Select the function you want to use and click Installation.

After the installation is completed, the configuration begins.

(1) Create a c++ solution

Click on View - Other Window - Attribute - Attribute Manager to open Debug | x64 (opencv only provides x64). For the convenience of our new project in the future, we need to configure it here by double-clicking Microsoft. Cpp. x64. user.

Double-click to enter the property page

Click on the VC++ directory

Add in the containing directory (install the directory according to your own reality)

D: Program Files opencv build include

D: Program Files opencv build include opencv2

Add in the Library Directory (install the directory according to your actual situation)

D: Program Files opencv build x64 vc15 Lib

Click Connector - Input - Additional Dependency to add opencv_world 410d.lib

After the above steps are completed, return to the solution and add a cpp file to the source file.

# include < opencv2 / opencv. HPP >

Using namespace cv;

Void main ()

{

Mat image = imread ("1.jpg");

Imshow ("[picture display]), image);

Imshow ("[picture display]), image);

WaitKey (0);

}

One

Two

Three

Four

Five

Six

Seven

Eight

Nine

Remember to add a picture 1.jpg to the same directory of main.cpp.

Select x64;

Above may have errors, for reference only, found errors can be commented and put forward to solve together.

-------------------------------

Author: qq_36144264

Source: CSDN

Original: https://blog.csdn.net/qq_36144264/article/details/89293891

Copyright Statement: This article is the original article of the blogger. Please attach a link to the blog article for reprinting.

CONTACT US

Contact: Manager Xu

Phone: 13907330718

Tel: 0731-22222718

Email: hniatcom@163.com

Add: Room 603, 6th Floor, Shifting Room, No. 2, Orbit Zhigu, No. 79 Liancheng Road, Shifeng District, Zhuzhou City, Hunan Province

Scan the qr codeClose
the qr code