当前位置:网站首页>[win10 vs2019 opencv4.6 configuration reference]
[win10 vs2019 opencv4.6 configuration reference]
2022-06-23 18:02:00 【A bowl of bean curd】
Catalog
opencv Of VS It takes only three minutes to configure the environment , But the various configurations on the Internet are dazzling , I don't know what to say opencv The compatibility of the two versions is too poor, or we should say that we are too good
I have given up treatment , Feeling VS It should still be in the garbage can , a pile BUG How nice to release
But , Who let me python Environment is the most used thing , Collected two configuration methods that have been compiled
( There will be warnings , Recommend the first , There seem to be fewer problems , At least a few dozen warnings )
My environment :
- win10 Education
- vs2019 Community Edition
- opencv4.6
1. download
The website links : The website links , Maybe it's slow , But the version is relatively new
Or I also put the official website opencv4.6 Upload the CSDN: Download link
2. Add environment variables
It is recommended to add environment variables , This can reduce one VS Operating environment configuration
decompression
- The downloaded package is a self extracting executable , Double click and select a good location to extract , Will automatically create a new... In the selected directory opencv Folder , You don't have to create it yourself

Add environment variables
- Right click Properties of this computer , Select advanced system settings -> environment variable - System variables , find Path double-click , Add one bin Catalog
Be careful , Don't add wrong , yes build/x64/vc15 The one inside , No build The one in the catalog , Adding errors will not find the library file
Or you can choose to configure this , The system environment variables are no longer configured :
And to system32 How to copy folders , I can only deeply worship this
3.VS2019 To configure
There are many online configurations , The difference is that the place where the library path is added is different
The first one is
- Select compilation configuration ,x64 The release , Experiment with other configurations

- In solution explorer, right-click the project and select properties

- stay C/C++ -> Attach include directory add header file path , Both of these need to be added , Be short of one cannot , Some tutorials only add one , Self testing
D:\lib\opencv\build\include
D:\lib\opencv\build\include\opencv2

4. Add library file path 
5. Add additional dependencies , This one doesn't have a path , There is also a suffix under the directory d Version of , yes Debug For compiling

After adding here, you can test
#include <opencv2/highgui.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
using namespace cv;
Test code :
Mat img = imread("./demo.jpg");
imshow("12345", img);
waitKey(2000);
destroyAllWindows();
The second kind
Open the property manager

Create a new configuration table , Any name , The default configuration table may be different from others , I don't know why I should configure it like this ..

Double-click to open , Add include directory , In many tutorials, three are added here , The new version doesn't need :

- Add Library Directory

5. Add linker additional dependencies , There is no need to add a path , Just copy the library name 
- After the configuration is completed, it is better to restart vs
边栏推荐
- Kerberoasting without SPN
- 论文阅读 (55):Dynamic Multi-Robot Task Allocation under Uncertainty and Temporal Constraints
- Lighthouse open source application practice: o2oa
- C. Phoenix and Towers-Codeforces Global Round 14
- Easygbs playback screen is continuously loading. Troubleshooting
- Petitpotam – NTLM relay to ad CS
- Programmers are very useful ten tool websites, which are worth collecting
- How to make validity table
- Meituan Sanmian: how do you understand the principle of redis master-slave replication?
- Year end: the "time value" and business methodology of live broadcast E-commerce
猜你喜欢

torch学习(一):环境配置
![[mae]masked autoencoders mask self encoder](/img/08/5ab2b0d5b81c723919046699bb6f6d.png)
[mae]masked autoencoders mask self encoder

FPN characteristic pyramid network

Date selection of hotel check-in time and check-out time

Alien world, real presentation, how does the alien version of Pokemon go achieve?

12 initialization of beautifulsoup class

Wechat applet: time selector for the estimated arrival date of the hotel

论文阅读 (56):Mutli-features Predction of Protein Translational Modification Sites (任务)

Hands on data analysis unit 2 section 4 data visualization

Meituan Sanmian: how do you understand the principle of redis master-slave replication?
随机推荐
qYKVEtqdDg
How to make a shirt certificate
[JS reverse hundred examples] pedata encryption information and zlib Application of gunzipsync()
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):...
Self supervised learning (SSL)
Postgresql_根据执行计划优化SQL
Analysis of object class structure in Nanny level teaching (common class) [source code attached]
论文阅读 (50):A Novel Matrix Game with Payoffs of Maxitive Belief Structure
Year end: the "time value" and business methodology of live broadcast E-commerce
如何通过线上股票开户?在线开户安全么?
What is the personal finance interest rate in 2022? How do individuals choose financial products?
Analysis of three battery capacity monitoring schemes
MySQL transaction submission process
Similarities and differences between Chinese and American electronic signature SaaS
[esp8266 - 01s] obtenir la météo, Ville, heure de Beijing
Digital intelligent supply chain collaboration solution for new energy industry
How to make validity table
Illustration of mongodb cluster deployment principle (3)
Call face recognition exception
浅析3种电池容量监测方案