当前位置:网站首页>How to permanently configure local opencv4.5.5 for vs2019
How to permanently configure local opencv4.5.5 for vs2019
2022-07-01 06:46:00 【SteveDraw】
Catalog :
Preface :
Due to actual development requirements , Need to put OpenCV original edition ( namely C and C++ Compiling ) Generate .dll( Dynamic link library ) for .Net Of C# Application usage , So we need to build a new one C++ Empty project to generate .dll. Therefore, it needs to be configured VS Tools and OpenCV The connection between , So make a special record and share experience , For your reference !
Environmental Science :windows10 pro +vs2019+opencv4.5.5
One , Download and install OpenCV
- If necessary , To specify the corresponding detailed version , It is suggested to go to the official website to download !
- If you just browse the source code , You can go to GitHub Corresponding warehouse learning view !
Click on The website links , Download the corresponding version you need to use , But what's worth noting here is , The version is not a random choice , To be used with you VS Version correspondence is good !( It is associated with the following configuration ) Reference to the corresponding version is given below ( Latest , The actual use will be different ):
| VC Version number | VS Corresponding version |
|---|---|
| vc6 | VC6.0 |
| vc7 | VS2002 |
| vc7.1 | VS2003 |
| vc8 | VS2005 |
| vc9 | VS2008 |
| vc10 | VS2010 |
| vc11 | VS2012 |
| vc12 | VS2013 |
| vc13 | VS2014 |
| vc14 | VS2015 |
| vc15 | VS2017 |
| vc16 | VS2019 |

- After jumping out of the following interface , Automatically download files after accounting ( This version is about 200 many m):

- After downloading , Open the installation file , And click unzip inside , Then automatically decompress !

- After decompression , You can accomplish it !

- Then you need to configure the environment variables of the system , Click OK after completing the following , It's better to restart it !

Two , To configure vs
- stay vs2019 Next , New empty project :


- Click View -> Other windows -> Property Manager

As shown below , Right click on the Microsoft.Cpp.x64.user, It's normal if you don't have this choice ( I asked online vs2019 Most don't have this , It needs to be replaced with vs2017), But there is a faster and more convenient way : Will be Microsoft.Cpp.x64.user Your computer can copy and paste the relevant configuration files into the corresponding directory on your computer , Find the table of contents “C:\Users\“ Your username ”\AppData\Local\Microsoft”,( Generally, it does not display AppData Folder , You need to check... In the folder view option “ Hidden items ” Make it visible ). Will download okay file MSBuild( Click to download ) Unzip and put it in the file directory :



- If configured as Debug, choice opencv_world455d.lib
- If Release, choice opencv_world455.lib


stay demo.cpp Add the following code under the file :
#include <opencv2/opencv.hpp>
#include "opencv2/imgcodecs/legacy/constants_c.h"
using namespace std;
using namespace cv;
void main(int argc, char* argv[]) {
// Read the image from the file
Mat img = imread("D:\\Z-File\\cv\\1.jpg", 1);
Mat dst;
// If reading in the image fails
if (img.empty()) {
printf(" Failed to open picture !\n");
}
namedWindow("RGB", WINDOW_AUTOSIZE);
imshow("RGB", img);
cvtColor(img, dst, COLOR_BGR2GRAY);
namedWindow("GRAY", WINDOW_AUTOSIZE);
imshow("GRAY", dst);
printf(" Test success ! Succeed in putting rgb Convert image to grayscale image !");
// This function waits for the key to be pressed , Press any key on the keyboard to return to
waitKey(0);
}
The above code is mainly a RGB The original image is converted to a grayscale image , And print out the prompt of success and the window of two figures !
Compile runtime , The following configuration is required !
If , The configuration is successful !
- After the above configuration is so successful , In the future, new projects don't need to be configured every time !
3、 ... and , Other articles recommend
- openc4.5.2 vs2019 Installation tutorial And the emergence of LNK110: Can't open file “opencv_world410d.lib Solutions for
- vs2019 LNK1104: Can't open file opencv_world3412d.obj
- C# call C++ Generated .dll File error : Exception in external component
- opencv4 The above version reports an error :CV_LOAD_IMAGE_COLOR and CV_BGR2HSV and CV_CAP_PROP_FRAME_WIDTH
- Visual Studio 2019 How to build a new one Win32 project
- 【OpenCV One of the introductory tutorials 】 install OpenCV:OpenCV 3.0、OpenCV 2.4.8、OpenCV 2.4.9 +VS Development environment configuration This blog post and bloggers highly recommend , Inside OpenCV Very detailed , Unfortunately, the blogger has gone ( The boss of geese factory )!
- win10 Next VS2019 To configure opencv-4.5.2 Environment configuration tutorial
Identifier not defined “CV_BGR2GRAY“
- The last thing I want to say is ,vs It's a big hole , Suggest using opencv and vs Not so new , Because the newer the words are vs The more difficult it is to configure , It is also recommended that you do not update to win11, Bigger pit , Finally installed successfully , You have to be roast MS Of !
- If there are deficiencies in the text , it is respectful to have you criticize and correct sth !
边栏推荐
- Stored procedure learning notes
- C language course set up salary management system (big homework)
- 了解ESP32睡眠模式及其功耗
- 脏读、幻读和不可重复读
- Figure out the difference between event coordinates screenx, clientx, pagex and offsetx
- Database objects: view learning records
- Internet worm
- SQL learning notes 2
- 产品学习(三)——需求列表
- MySQL data type learning notes
猜你喜欢

Using fuseki query when there are multiple models in TDB

【微信小程序】视图容器和基本内容组件

8 张图 | 剖析 Eureka 的首次同步注册表

解决无法读取META-INF.services里面定义的类

Esp32 monitors the battery voltage with ULP when the battery is powered

Methods of downloading Foreign Periodicals

Insufficient free space after clearing expired cache entries - consider increasing the maximum cache space

8 figures | analyze Eureka's first synchronization registry

产品学习(一)——结构图

WiFi settings for raspberry Pie 4
随机推荐
mysql约束学习笔记
【微信小程序】如何搭积木式开发?
How the esp32 deep sleep current is lower than 10uA
Is the account opening of Huafu securities safe and reliable? How to open Huafu securities account
根据输入画有向图
Rclone Chinese document: a collection of common commands
Chinese explanation of common rclone subcommands
如果我在广州,到哪里开户比较好?究竟网上开户是否安全么?
TCL statements in SQL (transaction control statements)
PAT (Advanced Level) Practice 1057 Stack
解决无法读取META-INF.services里面定义的类
SQL learning notes nine connections 2
Router 6/ 以及和Router5 的区别
转行做产品经理,如何挑选产品经理课程?
Camouflage request header Library: Anti useragent
Methods of downloading Foreign Periodicals
在支付宝上买基金安全吗?哪里可以买基金
Jena基于OWL的默认推理查询
MySQL data type learning notes
Introduction to spark (one article is enough)

